home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 31
/
CDASC_31_1996_juillet_aout.iso
/
vrac_os2
/
lxlt113.zip
/
LXUTIL.ENG
< prev
next >
Wrap
Text File
|
1996-05-06
|
12KB
|
231 lines
───────────────────────────────────
lxLite utility pack
───────────────────────────────────
1.Abstract
──────────
Some time after releasing version 1.01 of lxLite (i.e. 1.0.1) (and some
time before :-) I wrote some simple command-line utilites which greatly
simplified my life. Because apart from lxLite they don`t present nothing
interesting, I included them here for you to get them along with lxlite :-)
2.unLock
────────
unLock is a simple utility which allows to `unlock` application
executables which is currently in use. Normally when an executable is
loaded by OS/2 its file is open with a deny-write sharing mode. This is done
because LX format structure is designed not to swap out unused pages in
executables each time when they aren`t needed anymore, but rather to discard
them. When discardrd page is needed OS/2 simply reads it again from
executable.
However, there is still a way to replace executables `on-the-fly` even if
they are currently running. There is an so-called `well-known undocumented`
function (which in fact means that it won`t be neccesarily supported in
future versions of OS/2) which allow to disable sharing protection on such
files. Before doing that OS/2 reads entire executable in swap file, then
page swapping is done as with usual memory. If you`ll `unlock` many running
executables at the same time you can notice an increase in swap file size.
So, this is just an temporary work-around, you have better to reboot after
doing all neccesary things on former locked files.
The command-line format of unLock is much like lxLite`s, except that it
have much less options :-)
/E{+|-} r[E]cursive (+) file search through subdirectories
unLock will recursively search any directories which is
located below the directory of given filemask. If multiple
masks are given multiple recursive searchs will be performed.
/P{+|-} Enable (+) or disable (-) pause before each file
Before each file chCase will ask you whenever you really want
to unlock the file.
/V{+|-} Verbose (show a lot of additional information)
If verbose option is disabled (/V-) only those messages are
left on screen which displays critical messages (i.e. errors),
otherwise after each filename unLock shows the result of unlock
operation - 'unlocked' or 'sharing violation'. Note that unLock
CANNOT unlock files which are locked in some other way than
executbles.
/?,/H Show a short help screen
3.chCase
────────
Some time ago I was finally bored of the annoying habbit of some programs
to write their files in upper case. And not only contents (almost any
program which changes config.sys tends to convert it all to upper case when
I like it to be in lower case) but filenames also. So i started this little
project as a problem-dedicated-and-easy-to-use replacement for REN command.
The main ideology of chCase is to divide filename in some `parts` then to
perform some case-conversions on each part apart :-) You can define `part
separator` characters using /S"" option. By default chCase uses "." as `part
separator`. I.e. filename chcase.is.a.great.prog will be divided into parts
'chcase', 'is', 'a', 'great' and 'prog'. Further you can tell chCase to
convert first part to upper-case, second - to lower-case, third - to mixed
format (i.e. first letter in uppercase and rest in lowercase) and so on.
The available options are:
/C{#{.}} Convert to [L]ower/[U]pper/[M]ixed/[A]s-is case
You can define multiple `case conversion actions` - first one
will be applied on the first `part`; second - on the second
`part` and so on. Last `action` will be used for any extra
encountered `parts`, so if you`ll define only one option it
will be applyed on all filename parts. Some examples:
filename command line resulting filename
───────────────────────┬────────────────┬────────────────────────
mY.Very.lOnG.fIlE.NamE │/culam my* │MY.very.lOnG.File.Name
just.an.example │/cml jus* │Just.an.example
leT.iT.bE │/cmla let* │Let.it.bE
/E{+|-} r[E]cursive (+) file search through subdirectories
chCase will recursively search any directories which are
located below the directory of given filemask. If multiple
masks are given multiple recursive searchs will be performed.
/P{+|-} Enable (+) or disable (-) pause before each file
Before each file chCase will ask you whenever you really want
to rename this file. The initial and final filenames are
displayed.
/S"{#}" Define separator character(s) OVER old ones
You can use this switch in the case when you have some files
which uses some other separators, for example space or
underscore. Note that the /S switch is NOT additive i.e.
any /S switch disables the action of precedent. Even "."
is cleared by /S switch, so if you for example want to use
as separators both "." and space " " you have to define them
both in a single /S switch as follows: /S" ."
Just some examples:
filename command line resulting filename
───────────────────────┬────────────────┬────────────────────────
Mary has a Little.Lamb │/cm /s" ." mar* │Mary Has A Little.Lamb
john_wAs_a_lItTle_lame │/cuml /s"_" │JOHN_Was_a_little_lame
/V{+|-} Verbose (show a lot of additional information)
If you will specify /V- chcase will leave on screen only
critical messages such as errors - all others will be cleared
immediately after they succeeded.
/?,/H Show a short help screen
4.colMng
────────
ColMng is a simple utility which will allow you to manipulate PM color
palettes, in particular to save, restore, copy them from file to file as
well as copying them inside the same .INI file. All color palettes which are
visible in Scheme Palette are a entry in OS2SYS.INI; i.e. to copy color
palette from one system to another you have to save the needed entry into a
separate .INI file and to `load` color palette on target machine. Now some
words about how and where the palettes are saved: The `default` palette is
kept as a 'PM_Default_Colors` entry in OS2.INI file; it has the same
format as other palettes: the only difference between them is that most
palettes resides in OS2SYS.INI but default colors are kept in OS2.INI. The
entry has a lot of subentries such as `ShadowHiliteBgnd', 'FieldBackground',
'DesktopText` and so on.
Along with PM_Default_Colors there is another palette entry in OS2.INI
called PM_Colors. What is the difference between them? As far as I observed
PM_Default_Colors is the palette which is used when you load some other
shell replacement (not WPS), and PM_Colors seems to be used only when
WorkPlaceShell is loaded. Note that any change regarding system colors will
act only after reboot. There is a way to set colors directly, but I use
ColMng seldom and don`t bother about this :-)
ColMng is a command-line utility which have a lot of options (I already said
that I like them :-) They are:
/C{#} Set custom palette. To view a list of available palettes use blank
palette name. If you specify a name after /C this will copy specified
PM_# entry from OS2SYS.INI into PM_Default_Colors entry of OS2.INI file.
If you are using WorkPlace Shell you will not notice changes without
removing the PM_Colors entry (see /D option).
/S{#} Save color palette into resource file; empty name for default palette.
The specified palette (for example PM_Khaki_Colors) will be saved into
specified in command line file. The file will have a regular .INI
structure. For example ColMng /S mycols.ini will save PM_Default_Colors
entry into file `mycols.ini`.
/L{#} Load color palette from resource file; empty name for default palette
This is the inverse for /S function: it loads specified palette entries
from specified file: for example ColMng /L mycols.ini will restore
PM_Default_Colors from file 'mycols.ini'.
/R{#} Remove specified palette; empty name for default palette
This will remove specified entry *completely* from the .INI file.
You can remove obsolete palettes to keep .INIs small; you also can
remove default palette to restore to default PM colors.
/V{#} View sections in .INI file beginning from # (PM_ to list schemes)
This will display a list of sections in specified .INI file (or from
OS2SYS.INI if not specified) which starts from #. For example
ColMng /VPM_ will display a list of sections which refers to
Presentation Manager.
/A{#} Set alternative .INI file (for Save & Load operations)
By default save & load operations will use OS2.INI file if you
save or restore default colors and OS2SYS.INI file if you specified
other palette scheme. This switch allow you to specify directly
which .INI file to use for save & restore operations.
/D Set PM default colors to current colors
This switch will copy PM_Colors into PM_Default_Colors.
This option is useful if you are using an PM shell replacement
such as PC/2, FileBar, MegaDesk etc. When changing default palette
from WorkPlaceShell (Alt+drag scheme) for some reason WPS changes
only PM_Colors and PM_Default_Colors remain almost (???) the same,
however the background color seems to change as expected; however
most colors (for example selection fields, help background etc)
doesn`t change. Use ColMng /D to set palette for other shell
replacements.
Along with the ColMng itself I included a sample palette file called
AndyCols.ini which contains my current desktop colors (however I change
them very often :-) Use `ColMng /l andycols.ini` to try them then restart
the shell (or better reboot).
5.noEA
──────
As you probably know :-) many (in fact a lot) of files have EAs (extended
attributes), but does not need them. In fact the only thing which REALLY
needs extended attributes is your Desktop\ directory. All other files can or
can not have extended attributes - the only thing that you can lose by
removing those attributes is how that file will appear in WPS folder (size
and icon). Other type of extended attributes is those used by REXX - any
REXX program that you run at least once and which does not have ReadOnly
attribute set have some K of extended attributes attached to it even if it
does not really need them (I haven`t seen a REXX program which needs them).
So you can delete them and nothing will change except that you will win some
K of freespace on disk. Note that if you have not too many EAs (say the
.TYPE and the .APPTYPE ones) they will NOT occupy any disk space because of
the wise HPFS structure. So to use noEA you MUST know what you`re doing and
whenever you needs it.
noEA can show a list of extended attribute names for the processed files
or remove all of them. The command-line switches are much like in all other
utilites:
/E{+|-} r[E]cursive (+) file search through subdirectories
noEA will recursively search any directories which is
located below the directory of given filemask. If multiple
masks are given multiple recursive searchs will be performed.
/P{+|-} Enable (+) or disable (-) pause before each file
noEA will ask for confirmation before each processed file.
/V{+|-} Verbose (show EAs instead of removing them)
When this switch is used noEA will display the EAs attached
to processed file and will NOT remove them.
/Y{+|-} assume (+) on all queries first available responce
When noEA encounters an write-locked file it warns you about this.
However, this can be annoying when doing automatical processing
(i.e. calling noEA from batch files). You can force noEA to process
any files it can by specifying this switch.
/?,/H Show a short help screen