home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The CDPD Public Domain Collection for CDTV 1
/
CDPD_Vol1.bin
/
pd
/
551-575
/
558
/
btntape
/
tape.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1992-06-23
|
1KB
|
43 lines
/* TAPE.REXX: Sends useful commands to tape drive via BTN handler.
R. Rethemeyer 8/91
*/
address command
default_drive = "TAPE"
arg cmd drive .
if cmd="" then signal helpme
if drive="" then drive=default_drive
select
when abbrev("REWIND",cmd,3) then edata="01"
when abbrev("RETENSION",cmd,3) then edata="1B 00 00 00 03 00"
when abbrev("END",cmd,3) then edata="11 03"
when abbrev("WFM",cmd,3) then edata="10 00 00 00 01"
when abbrev("FORWARD",cmd,1) then edata="11 01 00 00 01"
when abbrev("BACKWARD",cmd,1) then do
'echo >'drive':RAWCMD "11 01 FF FF FE"' /* 2 steps back */
edata="11 01 00 00 01" /* 1 step forward */
end
when abbrev("ERASE",cmd,3) then do
say "Are you SURE you want to erase" drive "? (y/n)"
pull huh .
if substr(huh,1,1)~="Y" then signal byebye
'echo >'drive':RAWCMD "01"' /* rewind first */
edata="19 01"
end
otherwise signal helpme
end
'echo >'drive':RAWCMD "'edata'"'
byebye:
exit
helpme:
say "Syntax: [RX] TAPE <function> [device]"
say " function is one of:"
say " REWind, RETension, ERAse, WFM, END (skip to end of data),"
say " FORward (skip forward 1 file), BACK (skip back 1 file)."
say " If omitted, device defaults to TAPE"
exit