home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 6 File / 06-File.zip / filtyp.zip / filetype.cmd next >
OS/2 REXX Batch file  |  1994-11-03  |  2KB  |  52 lines

  1. /*********************************************************************/
  2. /*     REXX Function to determine partition file type                */
  3. /*********************************************************************/
  4. Parse Upper Arg partition .
  5.  
  6. /*********************************************************************/
  7. /*           Initialize REXXUtil environment (if not present)        */
  8. /*********************************************************************/
  9. rxload = RxFuncQuery('SysLoadFuncs')
  10. If rxload Then
  11.    Do
  12.       Call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
  13.       Call sysloadfuncs
  14.    End
  15.  
  16. /*********************************************************************/
  17. /*   Attempt to create a subdirectory that won't work on a FAT vol   */
  18. /*********************************************************************/
  19. result = SysMkDir(partition'\'willonlyworkonHPFS)
  20. Select
  21.  
  22. /*********************************************************************/
  23. /*   If the function was successful, it must be HPFS.  Remove the    */
  24. /*   directory we created.                                           */
  25. /*********************************************************************/
  26.    When result = 0 Then
  27.       Do
  28.          filetype = 'HPFS'
  29.          Call SysRmDir(partition'\'willonlyworkonHPFS)
  30.       End
  31.  
  32. /*********************************************************************/
  33. /*   If the function indicates an illegal name, it must be FAT       */
  34. /*********************************************************************/
  35.    When result = 206 Then
  36.       filetype = 'FAT'
  37.  
  38. /*********************************************************************/
  39. /*    Otherwise it must be a CD-ROM.                                 */
  40. /*********************************************************************/
  41.    Otherwise
  42.       filetype = 'CD-ROM'
  43. End
  44.  
  45. /*********************************************************************/
  46. /*      If we loaded REXXUtil, unload it, then exit, passing back    */
  47. /*      the filetype to the calling routine.                         */
  48. /*********************************************************************/
  49. If rxload Then
  50.    Call SysDropFuncs
  51. Return filetype
  52.