home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 6 File
/
06-File.zip
/
case16a.zip
/
case.doc
Wrap
Text File
|
1998-05-05
|
16KB
|
375 lines
============================================================================
CASE.DOC May 5, 1998
============================================================================
Ver 1.6a
This is a lower/upper/mixed-case conversion utility for file or dir names
on OS/2 or Win32 (Win95/NT) systems. This can also change letter cases of
.LONGNAME EAs on OS/2 system.
Key Features:
- lower/upper-case conversion of OS/2 HPFS or Win95/NT file/dir names
- lower/upper-case conversion of .LONGNAME EAs on HPFS and FAT on OS/2
- Rename real names on HPFS by their .LONGNAME EAs on OS/2
- mixed-case detection and conversion
This is a freeware if you don't modify the program. Use this program at
your own risk. Please distribute this document together with executables.
----------------------------------------------------------------------------
INTRODUCTION
----------------------------------------------------------------------------
[OS/2]
HPFS partitions of OS/2 support long file (and dir) names and the names
can be of either lower or upper or mixed cases. However, files and dirs
on FAT partitions are treated as upper-case names by OS/2 and become
upper-case names when they are copied to HPFS drives. We often like to
convert them into lower-case names, especially when we upload them to a
unix system that is case-sensitive for file names. Also we may want to
convert all names including dir names under a subdirectory tree on a HPFS
drive when the subdirectory tree was copied (unpacked) from an FAT partition.
CASE can solve the problem with a single line of command, with or without
touching mixed-case file/dir names.
OS/2 supports long file names on FAT partitions via .LONGNAME EAs (extended
attributes). WPS drive folders show the .LONGNAME EAs if they are available.
When files on FAT partition having .LONGNAME EAs are copied to HPFS partition,
the real names on HPFS partition are still of 8.3 names of FAT and the
.LONGNAME EAs are not reflected to the real names when copied with OS/2 CMD
shell's COPY command. (However, WPS drag-and-drop file copying will preserve
long names using .LONGNAME EAs when copied between HPFS and FAT drives.)
So files on HPFS may have .LONGNAME EAs (though it seems not necessary for
HPFS) which are different from the real file/dir names on disk.
CASE can replace real names (on HPFS partitions) by their .LONGNAME EAs
or convert letter cases of .LONGNAME EAs and/or real file/dir names.
[Win32]
This program was originally written for OS/2. Win32 is now supported by
RSXNT runtime library and a Win32 executable is included.
----------------------------------------------------------------------------
DISCLAIMER
----------------------------------------------------------------------------
This program may behave differently or incorrectly under Win95/NT than OS/2.
This program may have bugs as usual. However, don't blame me. Use at your
own risk.
----------------------------------------------------------------------------
INSTALLATION
----------------------------------------------------------------------------
Files included in case*.zip are
os2/case.exe - OS/2 executable require emxrt.zip
os2/cases.exe - stand-alone OS/2 executable (don't need emxrt.zip)
win32/case.exe - Win32 executable (requires RSXNT)
case.doc - this documentation
All these programs were compiled by emx/gcc 0.9c on OS/2, with RSXNT library
for Win32 version.
[OS/2 Users]
------------
To run OS/2 executable case.exe, emxrt.zip should be installed.
EMX runtime package is available from:
ftp://hobbes.nmsu.edu/os2/unix/emx09c/emxrt.zip
ftp://ftp.cdrom.com/pub/os2/unix/emx09c/emxrt.zip
ftp://ftp.uni-stuttgart.de/pub/systems/os2/emx-0.9c/emxrt.zip
Refer to documentations of emxrt.zip to install it.
After you install emxrt.zip, copy os2/case.exe to a directory in PATH.
The stand-alone executable os2/cases.exe does not require emxrt.zip, but
it is bigger than case.exe.
[Win95/NT Users]
----------------
To run Win32 executable on Win95/NT system, get RSXNT installed.
RSXNT runtime package (rsxn141r.zip) is available from:
http://www.mathematik.uni-bielefeld.de/~rainer/
(old links)
ftp://ftp.uni-bielefeld.de/pub/systems/ms-dos/misc/rsxnt14r.zip
ftp://ftp.cdrom.com/pub/tex/ctan/systems/msdos/dpmigcc/rsxnt14r.zip
ftp://ftp.dante.de/tex-archive/systems/msdos/dpmigcc/rsxnt14r.zip
This CASE program is not tested under WinNT, but tested on Win95.
[For All Users]
---------------
If you want to change the default settings of CASE, you may set 'CASEOPT'
env variable in your CONFIG.SYS or from a batch cmd file. For example,
set CASEOPT=-HS (No hidden, no system attrib; same as CASEOPT=-H -S)
Any options can be set in 'CASEOPT' env, but I would not recommend you
put options that can't be turned off from the command line. If you wish,
place -L+ in CASEOPT to convert .LONGNAME EAs (OS/2) as well by default:
set CASEOPT=-HS -L+ (convert both real names and .LONGNAME EAs)
Users of unix shell utilities may wish to change the program name to
something else to avoid command name conflict with 'case'.
If you keep a few copies of executables of different names, you can keep
different default settings via env settings. The rule for env name is that
program name (before .exe) in uppercase plus "OPT".
For example, if you copied the executable to 'lower.exe', the program will
first look for 'LOWEROPT' env before searching 'CASEOPT'. If 'LOWEROPT'
is found, 'CASEOPT' is not searched. (Notice that 'CASESOPT' env setting
will override 'CASEOPT' for cases.exe.) If you make another copy named
'upper.exe', you can set 'UPPEROPT' env for upper.exe. Of course, those
envs are not found, lower.exe and upper.exe share 'CASEOPT' env setting.
----------------------------------------------------------------------------
USAGE
----------------------------------------------------------------------------
This program is self-explanatory. 'case' and 'case -?' will display help
screens. (Even if you rename the executable file 'case.exe' to other name
the help screen will correctly display its new program name.)
Examples:
---------
case * converts all uppercase-only file names to lowercase names.
case -rqq * same as 'case *' but for all subdirs in very quiet mode.
case -ar * converts all dir and file names under current subdir tree.
case f:* converts files in the current dir of f:.
case MYDIR -d converts 'MYDIR' to lowercase name 'mydir'.
case -ru readme readme.txt
converts to uppercase names for all 'readme' and
'readme.txt' files under the current subdirectory tree.
case a* -x *.z gives the same result as "case -p [aA]* -x *.[zZ]".
(i.e. -p gives case-sensitive. But without -p is faster.)
case -p A* -x *.Z will search files of A* but not a* and will exclude *.Z
but not *.z.
NOTE:
Option switches can be placed anywhere or joined together except when
arguments are required (like -x).
So, the following commands are all equivalent:
case -r -q * -q -x *.Z -H -S +R -x *.ICO
case -rqqSHx *.Z *.ICO +R *
case -rqqHS +R * -x *.Z *.ICO
but not with
case -rqqHS +R -x *.Z *.ICO *
as '*' was target name pattern, but became the argument of -x.
Note that '-' or '+' terminates a list of multiple arguments.
When -L* switch is used and .LONGNAME EAs have <cr> <lf> ascii codes
(which are displayed as multiple-line names in a WPS desktop folder)
or some special codes, screen log by this program may be messy.
Use quiet mode (-q or -qq) if this could happen. Normally, .LONGNAME
may not(?) have control codes that would corrupt screens except
<cr> <lf> sequence, which just breaks lines on screen.
----------------------------------------------------------------------------
HISTORY
----------------------------------------------------------------------------
Ver 1.0 March 22, 1995
- first release to public
Ver 1.1 April 12, 1995
- replaced -v option with -q (default mode is now verbose)
and refined some verbose screen log messages
Ver 1.2 January 16, 1996
- New option: -x patterns (exclude names).
- New option: -p POSIX pattern matching (case-sensitive).
- Added -h help (in addition to -?) and 'case' alone gives shorter help
- Attribute conditions to select files/dirs: +R -R +H -H +S -S +A -A
- Added a feature: case conversion of parts seperately.
(-ne (=-n -e) will convert name and extension parts independently).
- Env var 'CASEOPT' for default settings.
- Extra env var: "prog_name"+"OPT" in uppercases.
- Compiled with emx/gcc 0.9b Fix01.
- Thanks to Stefan Deutscher (sad@utkux.utcc.utk.edu) for his good
suggestions.
Ver 1.2a January 17, 1996
- Bug fix: Didn't detect rename error.
- More message on help screen.
Ver 1.3 February 25, 1996
- Detects rename errors.
- Bug fix: tried to convert names that consist of non-alphbetic symbols.
- Bug fix: couldn't convert some mixed-case names.
- .LONGNAME EA support: -L switch added.
(suggested by Stefan Deutscher (sad@utkux.utcc.utk.edu).)
Ver 1.4 March 3, 1996
- New option switch: -L![+] to replace real names by .LONGNAME EAs
on HPFS partition. (Good when FAT files are copied to HPFS partition)
(suggested by Uli Wortmann (uli12@homer.geol.chemie.tu-muenchen.de).)
Ver 1.4a March 16, 1996
- PAGER support for long help screen
(suggested by Stefan Deutscher (sad@utkux.utcc.utk.edu).)
Ver 1.5 March 12, 1997
- Added:
-m option to convert to mixed cases.
@file to read target or exclude names from file.
-x[@] now supports drive and dir path names as well.
(-x@ to escape switch symbol in the next exclude name.)
-@ option to escape switch symbol in target name.
Ver 1.6 March 31, 1998
- Added Win32 support for Win95/NT (not tested under WinNT)
- Added: -mm option of `more' mixed-case conversion that converts
every subword into mixed-cases.
- Changed: -m (mixed-case) changes only the first letter to uppercase
in the given name parts of body name and extension.
Ver 1.6a May 5, 1998
- Fixed bug newly introduced in the last release.
(v1.6 missed target names without extensions.)
----------------------------------------------------------------------------
Help Screen (Actual output from 'case -?')
----------------------------------------------------------------------------
case Ver 1.6a - May 5 1998, Wonkoo Kim
Case Conversion of Dir/File Names
Syntax: case [options] [names ...] [-x exclude_names]
Options: (can go anywhere on command line even after '-x names')
-? -h Help screen (Add suffix '-' like -?- to override PAGER)
-a Change both (all) dir and file names (default: file names only)
-c Check only (debug) without actual case conversion
-d Change dir names only
-e Change cases in file extensions only (-n can be used together)
-f Force to change cases (even if there are mixed cases)
-l,u,[m]m Change non-mixed case names to lower, upper, [more] mixed cases
-n Change cases in file body names only (-e can be used together)
-p POSIX pattern matching of case-sensitive (affects -x as well)
-q[q] Quiet [quieter] mode ('-qq' is equivalent to '-q -q')
-r Recursively run for all subdirs below the specified one
+R -R +H -H +S -S +A -A With/out attributes(Readonly,Hidden,System,Archive)
-L[!][+|-] OS/2 .LONGNAME extended attribute (EA) support:
-L Change .LONGNAME EA; -L+ Change real name and EA; -L- No EA;
-L![+] Rename real names by .LONGNAME EAs [+ with case conversion]
'names' Target names (including @<file> form); support wildcards
@file Read "file" to get target or exclude names (Use -@ to escape)
-@ * Next argument is a target name (to escape '-','+','@' switches)
-x[@] names Exclude matching names (e.g. case * -x *.Z abc\* @filelist).
Description:
To convert letter cases of dir/file names (OS/2 HPFS or Win95/NT) and
OS/2 extended attribute (EA) .LONGNAME values (HPFS and FAT) of files,
or to replace real names on HPFS by .LONGNAME EAs with or without case
conversions.
Wildcards in POSIX Pattern Matching:
? matches any single character.
* matches zero or more occurances of anything.
[abc] matches any character of 'a', 'b', or 'c'.
[!abc] matches any character except 'a', 'b', and 'c'.
[a-z] matches any character from 'a' to 'z'.
Examples:
case * - convert all uppercase-only file names to lowercase names.
case -L+ * - same as above, but for both .LONGNAME EAs and file names. (OS/2)
case -L * - same as above, but change .LONGNAME EAs only. (OS/2)
case -ne * - convert name and extension separately to lowercases.
case -rqq * - same as 'case *' but for all subdirs in very quiet mode.
case -m * - convert lower or uppercase-only names to mixed-cases.
Options given: -m -mn -me -mne -mm
AA.BB.TXT ==> Aa.bb.Txt Aa.bb.TXT AA.BB.Txt Aa.bb.Txt Aa.Bb.Txt
case -L! * - replace file names (on HPFS) by .LONGNAME EAs. (OS/2)
case -L!+ * - same as -L! but with case conversion to lowercases. (OS/2)
case -p [A-K]* -x *.Z .* - (POSIX pattern matching) convert names that
start with A thru K but excluding names of *.Z and .* (starting with '.')
File/dir searching (for -x as well) is case sensitive when -p is given. So,
*.Z and *.z are different. The default action is case-insensitive search.
Use -@ or -x@ to escape switch symbol in the next argument.
For example: -x@ @foo @bar
where "@foo" itself and the names from file "bar" will be excluded.
Selecting files/dirs with attributes is based on 'AND' operator. That is,
'+HS -RA' means 'Hidden=1 AND System=1 AND ReadOnly=0 AND Archive=0.
'-HS' (= -H -S) selects files/dirs of not hidden nor system attributes.
.LONGNAME EA support of OS/2: (for FAT and HPFS partitions)
The default action is not to change .LONGNAME EAs. If either -L or -L+
was given, letter cases of .LONGNAME EAs are converted according to the
conversion rule chosen by option switches of -n, -e, -l, -u, -f, etc..
Note that names given on the command line should be the name patterns of
files/dirs, not of EAs, because .LONGNAME EAs are not searched as targets.
-L![+] option is useful when FAT files with .LONGNAME EAs are moved to
a HPFS partition. -L![+] does nothing on FAT partitions. When -L!+ is
applied to HPFS files/dirs, it also follows the conversion rule given by
option switches when replacing the real names, and converts .LONGNAME EAs
as well. So, use -L! if you want to keep .LONGNAME EAs unchanged.
Any invalid character for HPFS file/dir name is replaced by '!'.
Environmental Variables:
CASEOPT Set this env var to change the default behavior of this
program from either OS/2 config.sys or a batch cmd file.
If the last option in 'CASEOPT' setting is -x *,
then 'CASEOPT' setting must end with a '-'. For example,
set CASEOPT=-HS -L+ -x *.Z - (Note '-' at end)
set CASEOPT=-x *.Z -HS -L+ (Don't need '-' at end)
xxxOPT where 'xxx' is the executable name before '.' in uppercases.
For example, if you copied this program to 'lower.exe', lower
first searches LOWEROPT env for its default settings, and
then CASEOPT is searched only if LOWEROPT was not found.
PAGER Optionally set this env to use a pager (like less or list) for
this long help screen. If PAGER is not found, stdout is used.
Return Codes: (for single input)
0 - Successful Completion
1 - Invalid Command Switch or Argument
2 - Unable to OPEN
3 - Unable to READ
4 - Unable to WRITE
5 - Invalid Data/Format
6 - Invalid Name
7 - Error During Execution
8 - Help screen due to an error
-- Wonkoo Kim (wkim+@pitt.edu)