home *** CD-ROM | disk | FTP | other *** search
/ High Voltage Shareware / high1.zip / high1 / DIR24 / SHLONG10.ZIP / SHOWLONG.CMD next >
OS/2 REXX Batch file  |  1993-09-29  |  3KB  |  79 lines

  1. /*****************************************************************************/
  2. /* Show long filenames                                                       */
  3. /* By Paul Gallagher 1993                                                    */
  4. /*****************************************************************************/
  5.  
  6. '@echo off'
  7. versionStr='v1.0'
  8. Say "ShowLong" versionStr "by Paul Gallagher 1993 {paulg@a1.resmel.bhp.com.au}"
  9. Say
  10.  
  11. /*---------------------------------------------------------------------------*/
  12. /* Load REXXUTIL                                                             */
  13. /*---------------------------------------------------------------------------*/
  14. If RxFuncQuery('SysLoadFuncs') <> 0 Then
  15.   If RxFuncAdd('SysLoadFuncs','RexxUtil','SysLoadFuncs') <>0 Then Do
  16.     Say 'Unable to init REXX Utility function loader.'
  17.     Exit
  18.   End
  19. Call SysLoadFuncs
  20.  
  21. /*---------------------------------------------------------------------------*/
  22. /* Set error traps                                                           */
  23. /*---------------------------------------------------------------------------*/
  24. signal on failure name ExitProc
  25. signal on halt name ExitProc
  26. signal on syntax name ExitProc
  27.  
  28. /*---------------------------------------------------------------------------*/
  29. /* Do initial parse of command line and call help message if required        */
  30. /*---------------------------------------------------------------------------*/
  31. /* get the command line arguments */
  32. Parse Arg params
  33. /* call help routine if required */
  34. If Pos(Translate(params),"/?/HELP") > 0 Then Do
  35.   Call HelpInfo
  36.   Signal ExitProc
  37. End
  38.  
  39.  
  40. /*---------------------------------------------------------------------------*/
  41. /* Start user procedure                                                      */
  42. /*---------------------------------------------------------------------------*/
  43. validchars="ABCDEFGHIJKLMNOPQRSTUVWXYZ~!@#$%^&()-_{}'0123456789"
  44.  
  45. 'dir 'params'/s/b|RXQUEUE'
  46. 'echo **QENDS**|RXQUEUE'
  47.  
  48. Parse Pull fullpath
  49. Do While (fullpath\='**QENDS**')
  50.   Parse Value FileSpec("name",fullpath) with name'.'ext
  51.   If (Length(name)>8) | (Length(ext)>3) | (Verify(TRANSLATE(name''ext),validchars)\=0)Then Do
  52.     Say fullpath
  53.   End
  54.   Parse Pull fullpath
  55. End
  56.  
  57. /*---------------------------------------------------------------------------*/
  58. /* General exit procedure                                                    */
  59. /*---------------------------------------------------------------------------*/
  60. ExitProc:
  61.   Drop name ext fullpath validchars
  62.   Drop params versionStr
  63. Exit
  64. /*****************************************************************************/
  65. /* end of main routine                                                       */
  66. /*****************************************************************************/
  67.  
  68. /*****************************************************************************/
  69. /* routine to display help message                                           */
  70. /*****************************************************************************/
  71. HelpInfo: Procedure
  72.   Say " Lists all files/directories in a directory tree with"
  73.   Say " long (HPFS) filenames. This includes names that use"
  74.   Say " characters not normally allowed by DOS."
  75.   Say
  76.   Say " Usage:"
  77.   Say "        ShowLong [RootDir]"
  78.   Say
  79. Return