source: CMT/HEAD/mgr/cmt_lockfile.bat

Last change on this file was 430, checked in by rybkin, 17 years ago

See C.L. 336

File size: 501 bytes
Line 
1@echo off
2
3if "%1"=="" (
4  echo Usage: cmt_lockfile.bat file
5)
6
7SETLOCAL ENABLEDELAYEDEXPANSION
8if 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)
32ENDLOCAL
Note: See TracBrowser for help on using the repository browser.