home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Dr. CD ROM (Annual Premium Edition)
/
premium.zip
/
premium
/
IBMOS2_2
/
CDIR2.ZIP
/
CDIR2.DOC
< prev
next >
Wrap
Text File
|
1993-05-03
|
14KB
|
410 lines
Color DIRectory utility
Version 1.00 for OS/2
Copyright 1993 by Dale Couch
What is CDIR2?
--------------
CDIR2 is a utility that works the same as the DIR command that you are all
accustomed to with OS/2 with one exception, it displays all of the filenames in
color. You can configure the default colors to use, what colors the directory
entries should be, and you can define the color that files with certain
extensions or certain strings should be.
CDIR2 v1.00 (OS/2) Copyright 1993 by Dale Couch Page 2
How do I use CDIR2?
---------------------
SYNTAX: CDIR2 [drive:[path]] [options]
USAGE: Where drive represents a valid disk drive, locally attached or
remotely attached via a network.
Where path represents a valid path present on that drive.
Where [options] includes any of the following:
SYNTAX: /A[adshr][-a-d-s-h-r]
USAGE: Shows files with at least these attributes, based on the following:
a represents the archive attribute
d represents the directory attribute
s represents the directory attribute
h represents the hidden attribute
r represents the system attribute
if you include a '-' in front of an attribute all files that do not
have that attribute will be shown.
EXAMPLES:
CDIR2 /Aas
Will show all files that have the archive and system attribute bit
set on.
CDIR2 /A-a-d
Will show all files that do not have the archive bit set on and will
not show any directories.
CDIR2 /A
Will show all files, regardless of their attribute setting.
SYNTAX: /L
USAGE: Shows all filenames in lower case.
SYNTAX: /N
USAGE: Shows the file name at the end of the line instead of at the
beginning. This option is set on for all Installable File System
(IFS) drives, such as HPFS or CDFS, by default, and cannot be turned
off.
CDIR2 v1.00 (OS/2) Copyright 1993 by Dale Couch Page 3
[options] continued ...
SYNTAX: /O[degns][-d-e-g-n-s]
USAGE: Sorts the filenames in ascending order based on the following:
d represents sort on file date and time
e represents sort on file extension
g represents display directories first
n represents sort on file name
s represents sort on file size
If you wish to reverse the order of the sort, place a '-' before the
sort option.
The /On option will be ignored for all IFS drives, because it is
assumed that they are sorted in name order by default.
Note: If you receive a "Stack overflow!" message with this option
turned on, there are probably too many files (2000+) for CDIR2 to
sort. To correct this problem, either use a different Sort Option or
do not attempt to sort the directory listing.
EXAMPLES:
CDIR2 /Os
Will display files in smallest to largest file size order.
CDIR2 /O-s
Will display files in largest to smallest file size order.
SYNTAX: /P
USAGE: Pauses the display of files for each screen page. The page length
will be determined when CDIR2 is executed and will accommodate all
screen lengths. Pressing ESC at any Pause prompt will exit CDIR2
without displaying any more information.
SYNTAX: /S
USAGE: Recurse subdirectories, showing the contents of all subdirectories
from the current directory or [drive:[path]] down.
SYNTAX: /V
USAGE: Shows additional information about your command line options. It
will notify you of all of the options that are in effect.
CDIR2 v1.00 (OS/2) Copyright 1993 by Dale Couch Page 4
[options] continued ...
SYNTAX: /2
USAGE: Shows the directory listing in 2 columns on an 80 column display and
will display in as many columns as the screen will allow in any other
screen mode. The information that will be displayed, will be same
information that would be shown with the OS/2 DIR command.
SYNTAX: /3
USAGE: will display the directory listing in 3 columns on an 80 column
display and will display in as many columns as the screen will allow
in any other screen mode. The information that will be displayed is
the file name and file size.
How do I read the CDIR directory listing?
-----------------------------------------
1 2 3 4 5 6
CDIR2.EXE 12345 0 05-02-93 01:00a AHRS
1 is the files name
2 is the files size, for directory entries <DIR> will replace the number.
3 is the files Extended Attribute (EA) Size
4 is the files last access date
5 is the files last access time, where:
'a' represents am
'p' represents pm
6 shows the current file attributes, where:
'A' represents Archive
'H' represents Hidden
'R' represents Read Only
'S' represents System
'-' would represent that that attribute is not set to on for that file
CDIR2 v1.00 (OS/2) Copyright 1993 by Dale Couch Page 5
What should I know about the CDIR2.CFG configuration file?
----------------------------------------------------------
There are 4 components to the configuration file. There are definitions, which
are used to define colors for easier reading of the configuration file. To
define a color you just need to add a # before a word and then follow that by
a space and a numeric value between 0 and 255. The next component is the $
command. There are 3 $ commands: $OPTIONS, $COLOR, and $DIRECTORY which are
described below. Next there are the string identifiers. This is the string
that CDIR2 uses to identify a color sequence to use to display that file entry.
And finally there are comments, which are added by placing a ; anywhere on a new
line or after one of the other commands. A sample configuration file is
included at the end of this document. This configuration file can be shared
between CDIR2 (OS/2) and CDIR (DOS), just make sure that the configuration file
and each of the executables are in the same directory.
Please Note: The configuration file is read from top to bottom only once, so
you must declare any # variables before you use them or you will be notified of
an error.
What does the # command do?
---------------------------
The configuration file comes with all of the colors predefined using the #
command. If you want to be able to mix your own colors or define new names for
colors you can. If you want to be able to have a color like blinking red, do
this:
#BlinkRed RED + BLINK
Only the space between #BlinkRed and RED is required. Also at this time only
addition is supported when defining colors to use. You can use this addition
method for any color definition parameter in the configuration file.
What are the $ Commands?
------------------------
$OPTIONS -- allows you to define what options you want on at all times.
$OPTIONS /p /v
$COLOR -- allows you to define the default colors to use.
$COLOR LIGHTGRAY, BLACK
$DIRECTORY -- allows you to define the default colors to use for directory
entries.
$DIRECTORY WHITE, BLACK
Note: If you do not like using # variables you can always use numbers in
their place for any setting.
CDIR2 v1.00 (OS/2) Copyright 1993 by Dale Couch Page 6
How do I define the Colors CDIR2 should use?
--------------------------------------------
There are two separate ways to define what color files will appear in. If a
period '.' is the first character then it is assumed that for all occurrences
of files with that extension that color will be used. If any other character
is first it will be assumed that for all occurrences of the string, the color
you define will be used. This option will be overridden by the color set for
the extension.
.EXE WHITE, BLUE
CDIR2 YELLOW, BLUE
.DIZ RED+BLINK, BLACK
If we were to use the files that came in the CDIR2.ZIP file the following would
be a description of the output.
CDIR2.EXE and CDIR.EXE would appear in WHITE on a BLUE background.
CDIR2.CFG and CDIR2.DOC would appear in YELLOW on a BLUE background.
FILE_ID.DIZ would appear in BLINKing RED on a BLACK background.
What else should I know?
------------------------
CDIR2 does direct screen writes, so redirection of the output will not be
possible. This includes such command line functions as '> lpt1', '>>
filename.out', and '| more'.
There is a bug in all copies of OS/2 prior to the March 1993 Beta of OS/2 2.1.
This bug restricts CDIR2 from being able to locate file names contained on HPFS
drives that have any of the following characters " ~ ! @ # $ ( ) " for its first
character. Other IFS systems may be affected but I have not confirmed this.
The OS/2 DIR command does not exhibit this problem and should be used to display
these files.
CDIR2 looks for the .CFG file to be the same name. If you want to rename CDIR2
or CDIR to another name, be sure to rename the .CFG file to that same name, and
that the .CFG remains in the same directory as CDIR2. This will be the only way
that CDIR2 will be able to find the configuration file. The search order will
not change or be effected by a name change, a '2' will be appended when
necessary. CDIR2 will first look for CDIR2.CFG and then CDIR.CFG, CDIR will
first look for CDIR.CFG and then CDIR2.CFG.
CDIR2 v1.00 (OS/2) Copyright 1993 by Dale Couch Page 7
This is shareware
-----------------
CDIR2 is shareware and as such a monetary contribution of $5 would be greatly
appreciated. If you do not feel that a contribution is appropriate, but you do
like the program, would you please send me a post card letting me know where
CDIR2 has made it to.
Warranties
----------
The author is not responsible for any problems occurring because of the use or
misuse of this program. It is the user's responsibility to be aware of the
limitations of this program, whether documented here or not. This program is
not crippled in any way and you may freely copy this program and give it to your
friends.
Contacting the Author
---------------------
There are two ways that you can let me know that you like this program. The
first is to just send a post card to me at the below address. If you find the
program useful and would like to help finance future programs like this I would
appreciate a contribution of $5.00. You can send your post card or the
contribution to:
Dale Couch
5124 Conroy Road Suite 625
Orlando, FL 32811-3739
If you would prefer to just send me an electronic message I can be reached
through the RIME C conference at ->TREASURE, or on the Fido Net C conference.
Please feel free to make suggestions or notify me of any problems that you might
find.
Credits
-------
Finally, I have a few credits to give. First, I would like to thank my father
for acting as a concept sounding board, and having a knack for finding the
perfect piece of code. I would also like to thank Ryan Smith for helping me to
start and debug this project.
CDIR2 v1.00 (OS/2) Copyright 1993 by Dale Couch Page 8
Other Products
--------------
Syncit and Syncit/2 (Coming Soon)
----------------------------------
Syncit has been designed to compare the contents of directories or entire
drives, for those of you who maintain copies of files on other media. This is
also a perfect product for those people who need to constantly update a group
of network drives. It will compare all filenames, file sizes, file date, and
even their attributes and report on any files that do not match. This product
will be available for DOS and OS/2 2.x
Time Keeper/2 (Coming Soon)
----------------------------
Time Keeper/2 will help you keep track of the time that you spend is specific
applications while working in OS/2. Maintaining a log of the hours and
generating reports to give to your employers for billing purposes.
CDIR2 v1.00 (OS/2) Copyright 1993 by Dale Couch Page 9
;
; This is a sample configuration file for CDIR2. Just copy the
; contents of this page to the file CDIR2.CFG, if you are missing
; the original .CFG file.
;
#BLACK 0
#BLUE 1
#GREEN 2
#CYAN 3
#RED 4
#MAGENTA 5
#BROWN 6
#LIGHTGRAY 7
#DARKGRAY 8
#LIGHTBLUE 9
#LIGHTGREEN 10
#LIGHTCYAN 11
#LIGHTRED 12
#LIGHTMAGENTA 13
#YELLOW 14
#WHITE 15
#BLINK 128
;
; DEFAULT Program settings
;
$OPTIONS /p /v ; pause after each page and use verbose mode
$COLOR LIGHTGRAY, BLACK ; default text to white on black
$DIRECTORY LIGHTGRAY,BLACK ; default dir entries to white on black
;
; Begin Color Text definitions
;
.EXE WHITE, BLUE ; Comment after definition
CDIR2 YELLOW, BLUE
.DIZ RED+BLINK, BLACK