(view source code of driverdy.cmd as plain text)
/* DRIVEReaDY, Version 1.00 */
/* Check if drive is ready */
/* Written by Rob van der Woude */
/* Needs Quercus System's RexxLib */
/* Initialize RexxLib if necessary */
if RxFuncQuery( "RexxLibRegister" ) <> 0 then do
call RxFuncAdd "RexxLibRegister", "RexxLib", "RexxLibRegister"
call RexxLibRegister
end
/* Check command line parameter */
parse upper arg drive dummy
if dummy <> "" then call Syntax
drive = strip( drive )
drvlen = length( drive )
select
when drvlen > 2 then call Syntax
when drvlen = 2 then do
if right( drive, 1 ) <> ":" then call Syntax
drvletter = left( drive, 1 )
if drvletter < "A" | drvletter > "Z" then call Syntax
end
when drvlen = 1 then do
drive = drive||":"
if drvletter < "A" | drvletter > "Z" then call Syntax
end
otherwise call Syntax
end
/* Check if specified drive is ready */
if dosdisk( "T", drive ) = -1 then do
say "Drive "||drive||" is not ready"
rc = 1
end
else do
say "Drive "||drive||" is ready"
rc = 0
end
/* End of main program, exit with return code */
exit rc
Syntax:
say
say "DRIVEReaDY, Version 1.00 for OS/2"
say
say "Usage : DRIVERDY d:"
say
say " d: may be any drive from A: to Z:"
say
say "Returns : returncode 0 if ready, otherwise 1"
exit 255
return
page last modified: 2024-04-16; loaded in 0.0054 seconds