Line | |
---|
1 | @echo off |
---|
2 | |
---|
3 | if "%1"=="" ( |
---|
4 | echo Usage: cmt_lockfile.bat file |
---|
5 | ) |
---|
6 | |
---|
7 | SETLOCAL ENABLEDELAYEDEXPANSION |
---|
8 | if not "%1"=="" ( |
---|
9 | |
---|
10 | dir %~dp1 /a:d >nul 2>&1 |
---|
11 | if errorlevel 1 ( |
---|
12 | echo Giving up on "%~1" |
---|
13 | ) else ( |
---|
14 | |
---|
15 | fs examine -path %~dp1 >nul 2>&1 |
---|
16 | if not errorlevel 1 ( |
---|
17 | set fstype=afs |
---|
18 | ) |
---|
19 | |
---|
20 | :lock |
---|
21 | if "!fstype!"=="afs" ( |
---|
22 | fs flush -path %~dp1 |
---|
23 | ) |
---|
24 | mkdir %1 2>nul |
---|
25 | if errorlevel 1 ( |
---|
26 | ping -n 9 localhost >nul |
---|
27 | goto lock |
---|
28 | ) |
---|
29 | |
---|
30 | ) |
---|
31 | ) |
---|
32 | ENDLOCAL |
---|
Note: See
TracBrowser
for help on using the repository browser.