home *** CD-ROM | disk | FTP | other *** search
/ Hot Shareware 32 / hot34.iso / ficheros / OUTI / CASE16.ZIP / CASE.DOC
Text File  |  1998-03-31  |  16KB  |  368 lines

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