@set TEMPPR=%PROMPT%
@if NOT EXIST setup.bat goto ERR1
@call setup
@call mdd temp
@if NOT EXIST ..\volume.bat goto ERR2
@set PROMPT=# 

@REM # Fixing improper small file recognition in version 1.18 (see shortfile.at
@REM # and ChangeLog:2007-08-24), introduced another bug: when updating a
@REM # non-existing archive, tar-1.19 complained about its not being a tar archive
@REM # and exited immediately, leaving the created zero-sized file after it.
@REM # This bug was fixed on 2007-12-05.
@REM # Reported by: Ozan @,{C}a@v{g}layan <ozancag@gmail.com>
@REM # References: <4755A82A.9060607@gmail.com>

touch foo
@if NOT EXIST foo goto ERR3

%TEMPT% uf archive foo
@if NOT EXIST archive goto ERR4

%TEMPT% tvf archive

@cd ..
@goto END

:ERR1
@echo Can NOT locate setup.bat ... check name, location ...
@goto END

:ERR2
@echo mdd.bat missing, or failed ... check name, location ...
@goto END

:ERR3
@echo ERROR: touch did not create file foo ... maybe 'touch is NOT in PATH ...
@goto WAIT

:ERR4
@echo ERROR: %TEMPT% did not create file archive ... maybe %TEMPT% is NOT available ...
@goto WAIT

:WAIT
cd ..
@set PROMPT=%TEMPPR%
@pause
@goto END

:END
@set PROMPT=%TEMPPR%
