@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 File: ..\..\tests\shortrec.at 
@REM # Check that tar doesn't complain when reading short records.
@REM # This can happen when the input blocksize differs from the blocksize
@REM # used to create the archive.

md directory
@if NOT EXIST directory\nul goto ERR3

cd directory
touch a b c d e f g h i j k l m n o p q r
cd ..

@if NOT EXIST directory\a goto ERR4
@if NOT EXIST directory\r goto ERR4

%TEMPT% -c -b 1 -f - directory | %TEMPT% -t -f - >nul
@if ERRORLEVEL 1 goto ERR5
@REM %TEMPT% -c -b 1 -f - directory | %TEMPT% -t -f -
%TEMPT% -c -b 1 -f archive directory
%TEMPT% -t -f archive >nul
%TEMPT% -t -f - < archive >nul

@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: Unable to create directory ...
@goto WAIT

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

:ERR5
@echo ERROR: %TEMPT% exited with errorlevel %ERRORLEVEL% ... maybe %TEMPT% is NOT available or wrong version ...
@goto WAIT

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

:END
@set PROMPT=%TEMPPR%
