home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Professional / OS2PRO194.ISO / os2 / diskutil / sosutil / doc / chname.man next >
Text File  |  1993-10-18  |  3KB  |  92 lines

  1. ChName
  2.  
  3. Description
  4.  
  5.     Change long HPFS file names to FAT format  and  vice  versa.  Useful
  6.     when copying files to or from diskettes.
  7.  
  8. Usage
  9.  
  10.     [D:\] chname FILE ... [ /f /h /q /x /? ]
  11.  
  12.     /f  HPFS to FAT (default)
  13.     /h  FAT to HPFS (ie. reverse what was done with /f)
  14.     /q  Quiet mode
  15.     /x  Send output to a REXX queue instead of standard output
  16.     /?  Show help page and quit
  17.  
  18.     ChName changes HPFS file names to FAT format or vice versa.
  19.  
  20.  
  21.     HOW IT'S DONE
  22.  
  23.     When  changing  HPFS names to FAT, the program first simply tries to
  24.     truncate the name to the `????????.???'  mask.  Spaces are converted
  25.     to underlines, and the first and the last dot-separated part are put
  26.     together. For example,
  27.  
  28.         "What really happened to Baby Jane.txt.Z" -> WHAT_REA.Z
  29.  
  30.     If there already is a file with the same name, a part of the result-
  31.     ing  name  is  substituted with a number, eg. `WHAT_RE0.Z'.  Only as
  32.     many letters are substituted as necessary--first one number is tried
  33.     (0..9),  then two numbers  (00..99)  and so on.  Eventually a unique
  34.     file name is very probably found.
  35.  
  36.     The long HPFS file name is saved to the `.LONGNAME' extended attrib-
  37.     ute so that the name can later be restored with the `/h' switch, eg.
  38.  
  39.         WHAT_REA.Z -> "What really happened to Baby Jane.txt.Z"
  40.  
  41.  
  42.     USING REXX QUEUES
  43.  
  44.     The /x switch is designed to be a helpful addition for REXX program-
  45.     mers. With it, the output of ChName (ie. the old file names, whether
  46.     long or short,  and corresponding new names)  can be easily fetched.
  47.     For  example,  the  following  program  saves  all the long names to
  48.     `long_name'  stem  variable,   and   corresponding  short  names  to
  49.     `short_name' stem.
  50.  
  51.         /* example.cmd */
  52.  
  53.         "@echo off"
  54.         Parse Arg list
  55.  
  56.         n = 1
  57.         Do i = 1 To Words(list)
  58.             file = Word(list, i)
  59.             Call ChName file "/f /x"
  60.             Do While Queued() > 0
  61.                 Parse Pull long " -> " short
  62.                 long_name.n = long
  63.                 short_name.n = short
  64.                 n = n + 1
  65.             End
  66.         End
  67.  
  68. Known Bugs
  69.  
  70.     Spaces in file names cannot be handled  from  the command line,  ie.
  71.     you cannot use ChName like this:
  72.  
  73.         [D:\] chname "What really happened to Baby Jane.txt.Z"
  74.  
  75.     Because OS/2 seems to strip the quotes before anything reaches REXX,
  76.     ChName gives you a list of silly messages about files not found:
  77.  
  78.         ChName v1.0: File 'What' not found
  79.         ChName v1.0: File 'really' not found
  80.         ...
  81.  
  82.     But spaces ARE still allowed in  file names,  so  the  following  is
  83.     possible even if the  `*.txt.Z'  mask matched also files with spaces
  84.     in their names:
  85.  
  86.         [D:\] chname *.txt.Z
  87.  
  88. Version and Copyrights
  89.  
  90.     ChName v1.1b
  91.     (C) SuperOscar Softwares, Tommi Nieminen
  92.