(view source code of filesys.rex as plain text)
/* FileSys, Version 2.00 for OS/2 and Windows */
/* Written by Rob van der Woude */
/* http://www.robvanderwoude.com */
/* Parameter check */
Parse Upper Arg drive dummy
If dummy <> "" Then Call Syntax
If drive = "" Then Do
drive = FileSpec( "D", Directory( ) )
End
Else Do
If Pos( "?", drive ) > 0 Then Call Syntax
If Length( drive ) = 1 Then drive = drive||":"
If Length( drive ) > 2 Then Call Syntax
If right( drive, 1 ) <> ":" Then Call Syntax
If left( drive, 1 ) < "A" Then Call Syntax
If left( drive, 1 ) > "Z" Then Call Syntax
End
/* What OS? */
Parse Source os .
/* OS specific code */
If os = "OS/2" Then Do
/* Initialize RexxLib */
Call RxFuncAdd "RexxLibRegister", "RexxLib", "RexxLibRegister"
Call RexxLibRegister
/* Check if specified drive is ready, and get FS type if ready */
If DOSDISK( "T", drive ) = -1 Then filesys = "notready"; Else filesys = DOSFILESYS( drive )
End
Else Do
/* Initialize RexxUtil */
Call RxFuncAdd "sysloadfuncs", "RexxUtil", "sysloadfuncs"
Call sysloadfuncs
/* Get file system type */
filesys = SysFileSystemType( drive )
If filesys = "" Then filesys = "notready"
If filesys = "UFS" Then filesys = "unknown"
End
/* Display the result */
Say
If filesys = "notready" Then Do
Say "Drive "||drive||" is not ready"
End
Else Do
Say "File system of drive "||drive||" is "||filesys
End
/* End main program */
Exit 0
Syntax: Procedure
Say
Say "FileSys, Version 2.00 for OS/2 and Windows"
Say "Show the file system type for the specified drive"
Say
Say "Usage: FILESYS.REX [ drive ]"
Say
Say "If no drive is specified, the current drive is assumed."
Say 'Empty CDROM drives will return "not ready".'
If os = "OS/2" Then Say "OS/2 version needs Quercus Systems' REXXLIB"
Say
Say "Written by Rob van der Woude"
Say "http://www.robvanderwoude.com"
Exit 1
Return
page last modified: 2024-04-16; loaded in 0.0065 seconds