home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 6 File / 06-File.zip / case16a.zip / case.doc
Text File  |  1998-05-05  |  16KB  |  375 lines

  1. ============================================================================
  2. CASE.DOC                             May 5, 1998
  3. ============================================================================
  4.  
  5. Ver 1.6a
  6.  
  7. This is a lower/upper/mixed-case conversion utility for file or dir names
  8. on OS/2 or Win32 (Win95/NT) systems.  This can also change letter cases of
  9. .LONGNAME EAs on OS/2 system.
  10.  
  11. Key Features:
  12.     - lower/upper-case conversion of OS/2 HPFS or Win95/NT file/dir names
  13.     - lower/upper-case conversion of .LONGNAME EAs on HPFS and FAT on OS/2
  14.     - Rename real names on HPFS by their .LONGNAME EAs on OS/2
  15.     - mixed-case detection and conversion
  16.  
  17. This is a freeware if you don't modify the program.  Use this program at
  18. your own risk.    Please distribute this document together with executables.
  19.  
  20.  
  21. ----------------------------------------------------------------------------
  22. INTRODUCTION
  23. ----------------------------------------------------------------------------
  24.  
  25. [OS/2]
  26.  
  27. HPFS partitions of OS/2 support long file (and dir) names and the names
  28. can be of either lower or upper or mixed cases.  However, files and dirs
  29. on FAT partitions are treated as upper-case names by OS/2 and become
  30. upper-case names when they are copied to HPFS drives.  We often like to
  31. convert them into lower-case names, especially when we upload them to a
  32. unix system that is case-sensitive for file names.  Also we may want to
  33. convert all names including dir names under a subdirectory tree on a HPFS
  34. drive when the subdirectory tree was copied (unpacked) from an FAT partition.
  35. CASE can solve the problem with a single line of command, with or without
  36. touching mixed-case file/dir names.
  37.  
  38. OS/2 supports long file names on FAT partitions via .LONGNAME EAs (extended
  39. attributes).  WPS drive folders show the .LONGNAME EAs if they are available.
  40. When files on FAT partition having .LONGNAME EAs are copied to HPFS partition,
  41. the real names on HPFS partition are still of 8.3 names of FAT and the
  42. .LONGNAME EAs are not reflected to the real names when copied with OS/2 CMD
  43. shell's COPY command.  (However, WPS drag-and-drop file copying will preserve
  44. long names using .LONGNAME EAs when copied between HPFS and FAT drives.)
  45. So files on HPFS may have .LONGNAME EAs (though it seems not necessary for
  46. HPFS) which are different from the real file/dir names on disk.
  47. CASE can replace real names (on HPFS partitions) by their .LONGNAME EAs
  48. or convert letter cases of .LONGNAME EAs and/or real file/dir names.
  49.  
  50. [Win32]
  51.  
  52. This program was originally written for OS/2.  Win32 is now supported by
  53. RSXNT runtime library and a Win32 executable is included.
  54.  
  55. ----------------------------------------------------------------------------
  56. DISCLAIMER
  57. ----------------------------------------------------------------------------
  58.  
  59. This program may behave differently or incorrectly under Win95/NT than OS/2.
  60. This program may have bugs as usual.  However, don't blame me.  Use at your
  61. own risk.
  62.  
  63.  
  64. ----------------------------------------------------------------------------
  65. INSTALLATION
  66. ----------------------------------------------------------------------------
  67.  
  68. Files included in case*.zip are
  69.     os2/case.exe    - OS/2 executable require emxrt.zip
  70.     os2/cases.exe   - stand-alone OS/2 executable (don't need emxrt.zip)
  71.     win32/case.exe  - Win32 executable (requires RSXNT)
  72.     case.doc        - this documentation
  73.  
  74. All these programs were compiled by emx/gcc 0.9c on OS/2, with RSXNT library
  75. for Win32 version.
  76.  
  77.  
  78. [OS/2 Users]
  79. ------------
  80. To run OS/2 executable case.exe, emxrt.zip should be installed.
  81. EMX runtime package is available from:
  82.  
  83.     ftp://hobbes.nmsu.edu/os2/unix/emx09c/emxrt.zip
  84.     ftp://ftp.cdrom.com/pub/os2/unix/emx09c/emxrt.zip
  85.     ftp://ftp.uni-stuttgart.de/pub/systems/os2/emx-0.9c/emxrt.zip
  86.  
  87. Refer to documentations of emxrt.zip to install it.
  88.  
  89. After you install emxrt.zip, copy os2/case.exe to a directory in PATH.
  90. The stand-alone executable os2/cases.exe does not require emxrt.zip, but
  91. it is bigger than case.exe.
  92.  
  93.  
  94. [Win95/NT Users]
  95. ----------------
  96. To run Win32 executable on Win95/NT system, get RSXNT installed.
  97. RSXNT runtime package (rsxn141r.zip) is available from:
  98.  
  99.     http://www.mathematik.uni-bielefeld.de/~rainer/
  100.  
  101.     (old links)
  102.     ftp://ftp.uni-bielefeld.de/pub/systems/ms-dos/misc/rsxnt14r.zip
  103.     ftp://ftp.cdrom.com/pub/tex/ctan/systems/msdos/dpmigcc/rsxnt14r.zip
  104.     ftp://ftp.dante.de/tex-archive/systems/msdos/dpmigcc/rsxnt14r.zip
  105.  
  106. This CASE program is not tested under WinNT, but tested on Win95.
  107.  
  108.  
  109. [For All Users]
  110. ---------------
  111. If you want to change the default settings of CASE, you may set 'CASEOPT'
  112. env variable in your CONFIG.SYS or from a batch cmd file.  For example,
  113.  
  114.     set CASEOPT=-HS    (No hidden, no system attrib; same as CASEOPT=-H -S)
  115.  
  116. Any options can be set in 'CASEOPT' env, but I would not recommend you
  117. put options that can't be turned off from the command line.  If you wish,
  118. place -L+ in CASEOPT to convert .LONGNAME EAs (OS/2) as well by default:
  119.  
  120.     set CASEOPT=-HS -L+     (convert both real names and .LONGNAME EAs)
  121.  
  122. Users of unix shell utilities may wish to change the program name to
  123. something else to avoid command name conflict with 'case'.
  124.  
  125. If you keep a few copies of executables of different names, you can keep
  126. different default settings via env settings.  The rule for env name is that
  127. program name (before .exe) in uppercase plus "OPT".
  128.  
  129. For example, if you copied the executable to 'lower.exe', the program will
  130. first look for 'LOWEROPT' env before searching 'CASEOPT'.  If 'LOWEROPT'
  131. is found, 'CASEOPT' is not searched. (Notice that 'CASESOPT' env setting
  132. will override 'CASEOPT' for cases.exe.)  If you make another copy named
  133. 'upper.exe', you can set 'UPPEROPT' env for upper.exe.  Of course, those
  134. envs are not found, lower.exe and upper.exe share 'CASEOPT' env setting.
  135.  
  136.  
  137. ----------------------------------------------------------------------------
  138. USAGE
  139. ----------------------------------------------------------------------------
  140.  
  141. This program is self-explanatory.  'case' and 'case -?' will display help
  142. screens.  (Even if you rename the executable file 'case.exe' to other name
  143. the help screen will correctly display its new program name.)
  144.  
  145.  
  146. Examples:
  147. ---------
  148.  
  149.   case *        converts all uppercase-only file names to lowercase names.
  150.  
  151.   case -rqq *        same as 'case *' but for all subdirs in very quiet mode.
  152.  
  153.   case -ar *        converts all dir and file names under current subdir tree.
  154.  
  155.   case f:*        converts files in the current dir of f:.
  156.  
  157.   case MYDIR -d     converts 'MYDIR' to lowercase name 'mydir'.
  158.  
  159.   case -ru readme readme.txt
  160.             converts to uppercase names for all 'readme' and
  161.             'readme.txt' files under the current subdirectory tree.
  162.  
  163.   case a* -x *.z    gives the same result as "case -p [aA]* -x *.[zZ]".
  164.             (i.e. -p gives case-sensitive. But without -p is faster.)
  165.  
  166.   case -p A* -x *.Z    will search files of A* but not a* and will exclude *.Z
  167.             but not *.z.
  168.  
  169. NOTE:
  170.     Option switches can be placed anywhere or joined together except when
  171.     arguments are required (like -x).
  172.  
  173.     So, the following commands are all equivalent:
  174.  
  175.     case -r -q * -q -x *.Z -H -S +R -x *.ICO
  176.     case -rqqSHx *.Z *.ICO +R *
  177.     case -rqqHS +R * -x *.Z *.ICO
  178.  
  179.     but not with
  180.  
  181.     case -rqqHS +R -x *.Z *.ICO *
  182.  
  183.     as '*' was target name pattern, but became the argument of -x.
  184.     Note that '-' or '+' terminates a list of multiple arguments.
  185.  
  186.     When -L* switch is used and .LONGNAME EAs have <cr> <lf> ascii codes
  187.     (which are displayed as multiple-line names in a WPS desktop folder)
  188.     or some special codes, screen log by this program may be messy.
  189.     Use quiet mode (-q or -qq) if this could happen.  Normally, .LONGNAME
  190.     may not(?) have control codes that would corrupt screens except
  191.     <cr> <lf> sequence, which just breaks lines on screen.
  192.  
  193.  
  194. ----------------------------------------------------------------------------
  195. HISTORY
  196. ----------------------------------------------------------------------------
  197.     Ver 1.0   March 22, 1995
  198.     - first release to public
  199.  
  200.     Ver 1.1   April 12, 1995
  201.     - replaced -v option with -q (default mode is now verbose)
  202.       and refined some verbose screen log messages
  203.  
  204.     Ver 1.2    January 16, 1996
  205.     - New option: -x patterns (exclude names).
  206.     - New option: -p POSIX pattern matching (case-sensitive).
  207.     - Added -h help (in addition to -?) and 'case' alone gives shorter help
  208.     - Attribute conditions to select files/dirs: +R -R +H -H +S -S +A -A
  209.     - Added a feature: case conversion of parts seperately.
  210.       (-ne (=-n -e) will convert name and extension parts independently).
  211.     - Env var 'CASEOPT' for default settings.
  212.     - Extra env var: "prog_name"+"OPT" in uppercases.
  213.     - Compiled with emx/gcc 0.9b Fix01.
  214.     - Thanks to Stefan Deutscher (sad@utkux.utcc.utk.edu) for his good
  215.       suggestions.
  216.  
  217.     Ver 1.2a    January 17, 1996
  218.     - Bug fix: Didn't detect rename error.
  219.     - More message on help screen.
  220.  
  221.     Ver 1.3    February 25, 1996
  222.     - Detects rename errors.
  223.     - Bug fix: tried to convert names that consist of non-alphbetic symbols.
  224.     - Bug fix: couldn't convert some mixed-case names.
  225.     - .LONGNAME EA support: -L switch added.
  226.       (suggested by Stefan Deutscher (sad@utkux.utcc.utk.edu).)
  227.  
  228.     Ver 1.4    March 3, 1996
  229.     - New option switch: -L![+] to replace real names by .LONGNAME EAs
  230.       on HPFS partition. (Good when FAT files are copied to HPFS partition)
  231.       (suggested by Uli Wortmann (uli12@homer.geol.chemie.tu-muenchen.de).)
  232.  
  233.     Ver 1.4a    March 16, 1996
  234.     - PAGER support for long help screen
  235.       (suggested by Stefan Deutscher (sad@utkux.utcc.utk.edu).)
  236.  
  237.     Ver 1.5    March 12, 1997
  238.     - Added:
  239.         -m option to convert to mixed cases.
  240.         @file to read target or exclude names from file.
  241.         -x[@] now supports drive and dir path names as well.
  242.           (-x@ to escape switch symbol in the next exclude name.)
  243.         -@ option to escape switch symbol in target name.
  244.  
  245.     Ver 1.6    March 31, 1998
  246.     - Added Win32 support for Win95/NT (not tested under WinNT)
  247.     - Added:    -mm option of `more' mixed-case conversion that converts
  248.             every subword into mixed-cases.
  249.     - Changed:  -m (mixed-case) changes only the first letter to uppercase
  250.             in the given name parts of body name and extension.
  251.  
  252.     Ver 1.6a    May 5, 1998
  253.     - Fixed bug newly introduced in the last release.
  254.         (v1.6 missed target names without extensions.)
  255.  
  256.  
  257. ----------------------------------------------------------------------------
  258. Help Screen (Actual output from 'case -?')
  259. ----------------------------------------------------------------------------
  260.  
  261. case  Ver 1.6a - May  5 1998,  Wonkoo Kim
  262. Case Conversion of Dir/File Names
  263.  
  264. Syntax: case [options] [names ...] [-x exclude_names]
  265.  
  266. Options: (can go anywhere on command line even after '-x names')
  267.    -? -h      Help screen (Add suffix '-' like -?- to override PAGER)
  268.    -a          Change both (all) dir and file names (default: file names only)
  269.    -c          Check only (debug) without actual case conversion
  270.    -d          Change dir names only
  271.    -e          Change cases in file extensions only (-n can be used together)
  272.    -f          Force to change cases (even if there are mixed cases)
  273.    -l,u,[m]m  Change non-mixed case names to lower, upper, [more] mixed cases
  274.    -n          Change cases in file body names only (-e can be used together)
  275.    -p          POSIX pattern matching of case-sensitive (affects -x as well)
  276.    -q[q]      Quiet [quieter] mode ('-qq' is equivalent to '-q -q')
  277.    -r          Recursively run for all subdirs below the specified one
  278.    +R -R +H -H +S -S +A -A  With/out attributes(Readonly,Hidden,System,Archive)
  279.    -L[!][+|-] OS/2 .LONGNAME extended attribute (EA) support:
  280.       -L  Change .LONGNAME EA;  -L+ Change real name and EA;  -L- No EA;
  281.        -L![+] Rename real names by .LONGNAME EAs [+ with case conversion]
  282.    'names'    Target names (including @<file> form); support wildcards
  283.    @file      Read "file" to get target or exclude names (Use -@ to escape)
  284.    -@ *       Next argument is a target name (to escape '-','+','@' switches)
  285.    -x[@] names     Exclude matching names (e.g. case * -x *.Z abc\* @filelist).
  286.  
  287. Description:
  288.  
  289.    To convert letter cases of dir/file names (OS/2 HPFS or Win95/NT) and
  290.    OS/2 extended attribute (EA) .LONGNAME values (HPFS and FAT) of files,
  291.    or to replace real names on HPFS by .LONGNAME EAs with or without case
  292.    conversions.
  293.  
  294. Wildcards in POSIX Pattern Matching:
  295.  
  296.    ?       matches any single character.
  297.    *       matches zero or more occurances of anything.
  298.    [abc]   matches any character of 'a', 'b', or 'c'.
  299.    [!abc]  matches any character except 'a', 'b', and 'c'.
  300.    [a-z]   matches any character from 'a' to 'z'.
  301.  
  302. Examples:
  303.  
  304.    case *    - convert all uppercase-only file names to lowercase names.
  305.    case -L+ *    - same as above, but for both .LONGNAME EAs and file names. (OS/2)
  306.    case -L *    - same as above, but change .LONGNAME EAs only. (OS/2)
  307.    case -ne *    - convert name and extension separately to lowercases.
  308.    case -rqq *    - same as 'case *' but for all subdirs in very quiet mode.
  309.    case -m *    - convert lower or uppercase-only names to mixed-cases.
  310.        Options given:  -m      -mn         -me    -mne       -mm
  311.        AA.BB.TXT  ==>  Aa.bb.Txt  Aa.bb.TXT  AA.BB.Txt    Aa.bb.Txt  Aa.Bb.Txt
  312.  
  313.    case -L! *    - replace file names (on HPFS) by .LONGNAME EAs. (OS/2)
  314.    case -L!+ *    - same as -L! but with case conversion to lowercases. (OS/2)
  315.  
  316.    case -p [A-K]* -x *.Z .*  - (POSIX pattern matching) convert names that
  317.      start with A thru K but excluding names of *.Z and .* (starting with '.')
  318.  
  319.    File/dir searching (for -x as well) is case sensitive when -p is given.  So,
  320.    *.Z and *.z are different.  The default action is case-insensitive search.
  321.  
  322.    Use -@ or -x@ to escape switch symbol in the next argument.
  323.    For example:  -x@ @foo @bar
  324.    where "@foo" itself and the names from file "bar" will be excluded.
  325.  
  326.    Selecting files/dirs with attributes is based on 'AND' operator. That is,
  327.    '+HS -RA' means 'Hidden=1 AND System=1 AND ReadOnly=0 AND Archive=0.
  328.  
  329.    '-HS' (= -H -S) selects files/dirs of not hidden nor system attributes.
  330.  
  331. .LONGNAME EA support of OS/2: (for FAT and HPFS partitions)
  332.  
  333.    The default action is not to change .LONGNAME EAs.  If either -L or -L+
  334.    was given, letter cases of .LONGNAME EAs are converted according to the
  335.    conversion rule chosen by option switches of -n, -e, -l, -u, -f, etc..
  336.    Note that names given on the command line should be the name patterns of
  337.    files/dirs, not of EAs, because .LONGNAME EAs are not searched as targets.
  338.  
  339.    -L![+] option is useful when FAT files with .LONGNAME EAs are moved to
  340.    a HPFS partition.  -L![+] does nothing on FAT partitions.  When -L!+ is
  341.    applied to HPFS files/dirs, it also follows the conversion rule given by
  342.    option switches when replacing the real names, and converts .LONGNAME EAs
  343.    as well.  So, use -L! if you want to keep .LONGNAME EAs unchanged.
  344.    Any invalid character for HPFS file/dir name is replaced by '!'.
  345.  
  346. Environmental Variables:
  347.  
  348.    CASEOPT     Set this env var to change the default behavior of this
  349.            program from either OS/2 config.sys or a batch cmd file.
  350.            If the last option in 'CASEOPT' setting is -x *,
  351.            then 'CASEOPT' setting must end with a '-'.  For example,
  352.  
  353.            set CASEOPT=-HS -L+ -x *.Z -    (Note '-' at end)
  354.            set CASEOPT=-x *.Z -HS -L+      (Don't need '-' at end)
  355.  
  356.    xxxOPT      where 'xxx' is the executable name before '.' in uppercases.
  357.            For example, if you copied this program to 'lower.exe', lower
  358.            first searches LOWEROPT env for its default settings, and
  359.            then CASEOPT is searched only if LOWEROPT was not found.
  360.  
  361.    PAGER       Optionally set this env to use a pager (like less or list) for
  362.            this long help screen.  If PAGER is not found, stdout is used.
  363.  
  364. Return Codes: (for single input)
  365.    0 - Successful Completion
  366.    1 - Invalid Command Switch or Argument
  367.    2 - Unable to OPEN
  368.    3 - Unable to READ
  369.    4 - Unable to WRITE
  370.    5 - Invalid Data/Format
  371.    6 - Invalid Name
  372.    7 - Error During Execution
  373.    8 - Help screen due to an error
  374.  
  375. -- Wonkoo Kim (wkim+@pitt.edu)