Rob van der Woude's Scripting Pages
Powered by GeSHi

Source code for filesys.cmd

(view source code of filesys.cmd as plain text)

  1. /* FileSys, Version 1.00 for OS/2 */
  2. /* Written by Rob van der Woude   */
  3. /* http://www.robvanderwoude.com  */
  4.  
  5. /* Initialize RexxLib */
  6. call RxFuncAdd "RexxLibRegister", "RexxLib", "RexxLibRegister"
  7. call RexxLibRegister
  8.  
  9. /* Parameter check */
  10. parse upper arg drive dummy
  11. if dummy <> "" then call Syntax
  12. if drive = "" then do
  13. 	drive = filespec( "D", directory( ) )
  14. end
  15. else do
  16. 	if pos( "?", drive ) > 0 then call Syntax
  17. 	if length( drive ) = 1 then drive = drive||":"
  18. 	if length( drive ) > 2 then call Syntax
  19. 	if right( drive, 1 ) <> ":" then call Syntax
  20. 	if left( drive, 1 ) < "A" then call Syntax
  21. 	if left( drive, 1 ) > "Z" then call Syntax
  22. end
  23.  
  24. /* Check if specified drive is ready */
  25. if dosdisk( "T", drive ) = -1 then do
  26. 	say
  27. 	say "Drive "||drive||" is not ready"
  28. 	EXIT 1
  29. end
  30.  
  31. /* Now that that's done, let's get the file system */
  32. say
  33. say "File system of drive "||drive||" is "||DOSFILESYS( drive )
  34.  
  35. /* End main program */
  36. EXIT 0
  37.  
  38.  
  39. Syntax:
  40. 	say
  41. 	say "FileSys, Version 1.00 for OS/2"
  42. 	say "Written by Rob van der Woude"
  43. 	say
  44. 	say "Usage: FILESYS [ drive ]"
  45. 	say
  46. 	say "If no drive is specified, current drive is assumed"
  47. 	EXIT 2
  48. return
  49.  

page last modified: 2024-04-16; loaded in 0.0077 seconds