home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 6 File
/
06-File.zip
/
dirp202.zip
/
dirp.doc
next >
Wrap
Text File
|
1995-04-16
|
15KB
|
390 lines
DIRP v2.02 - Copyright (c) 1995 Richard Hulme All Rights Reserved
DIRP is essentially the same as the standard DIR command. However, DIRP will
only list programs (i.e. those files which can be executed).
I find that this program helps enormously when you change into a directory
with tens or hundreds of files, or when you have decompressed an archive
which has just filled your directory with all sorts of files. You can see at
a glance what program to run.
This version of DIRP now includes support for nearly all of the normal DIR
switches as well as being able to run under OS/2 or DOS.
Although the program's output is almost identical to the normal DOS or OS/2
output, none of the code (pure assembler!) has been ripped from COMMAND.COM
or CMD.EXE.
What follows is the usage for the DOS version. After that is a description
of any differences in the OS/2 version.
--------------------------------------------------------------------------------
The syntax for DIRP is:
DIRP [drive:][directory][filespec] [/A[ashr]] [/B] [/F] [/L] [/MAN]
[/N] [/O[neds]] [/P] [/R] [/S] [/W]
[drive:][dir] specify the drive and directory to list
[filespec] specifies all programs matching a pattern
(filename portion must contain at least one of '?' or '*')
/A[ashr] List only programs with specified attribute
a Archive s System h Hidden r Read Only
/B Bare format - program names only
/F Show fully-qualified program names
/L Display program names in lower-case
/MAN Create DIRP.DOC in current directory
/N Show program list in new OS/2 format
/O[neds] Order programs.
n Name e Extension d Date & Time s Size - Reverses order
/P Pause after each screenful
/R Display .LONGNAME extended attribute (in an OS/2 VDM only)
/S Display programs in sub-directories
/W Display program names across the screen
The above can be displayed by using the /? switch.
File Specification
------------------
The number of programs displayed can be restricted by the use of wildcard
characters (? and *). The question mark represents a single character and
the asterisk represents any number of characters.
For example:
DIRP SE*.* - This will match any program such as 'SEARCH.EXE',
'SETUP.COM' etc.
DIRP ?LET - This will match any program such as 'ALET.BAT',
'1LET.COM' etc.
DIRP L?ST*.* - This will match any program such as 'LAST.COM',
'LISTER.EXE' etc.
When specifying the filespec, any extension given is ignored (since this
defeats the point of matching .EXE, .COM and .BAT). If a filespec is given,
the filename portion of it must contain at least one wildcard character
(i.e. ? or *).
Switches
--------
All switches can be placed in an environment variable (except /MAN) so that
you can alter the default action. For example, to make sure that all programs
are sorted into alphabetical order, place the following line in your
AUTOEXEC.BAT:
SET DIRCMD=/ONE
Attribute Mask - /A
-------------------
This switch allows you to restrict the list of programs output to those
with, or without, particular attributes.
On its own, all programs, even those with the hidden and system attributes,
are displayed.
By following the /A with one or more options, you can select only certain
attributes.
R Display all programs with the READ-ONLY attribute set
A Display all programs with the ARCHIVE attribute set
S Display all programs with the SYSTEM attribute set
H Display all programs with the HIDDEN attribute set
Preceding the option with a hyphen ('-') makes that option inverted, so:
-R Display all programs with the READ-ONLY attribute reset
-A Display all programs with the ARCHIVE attribute reset
-S Display all programs with the SYSTEM attribute reset
-H Display all programs with the HIDDEN attribute reset
In fact, /-A will reset any previous attribute masks and only display those
programs which don't have the SYSTEM or HIDDEN attribute set.
Examples
--------
DIRP /A Display all programs
DIRP /AR Display all programs which are READ-ONLY
Ignore any programs which don't have it set
DIRP /A-RH-A Display all programs which are not READ-ONLY,
have the hidden attribute set, and don't have
the ARCHIVE attribute set.
If, for example, you specify /AH on the command line, this does not mean
'display programs with only the HIDDEN attribute set'. It means 'display
programs with *at least* the HIDDEN attribute set'. If you wanted programs
with only the HIDDEN attribute set, you should put /AH-R-S-A on the command
line.
N.B. The order of the options is unimportant.
Bare Format - /B
----------------
This switch will only display the program names. The header information
is not displayed (volume label, serial number, current directory), nor is
any information about each file other than its name. Also, no summary
information is displayed (total number of bytes used, total number of bytes
free).
For example:
DIRP.EXE
DISKEDIT.COM
.
.
.
etc.
Fully-Qualified Program Names - /F
----------------------------------
This switch is effectively the same as /B, except that the drive letter and
full path for each file is displayed.
For example:
C:\UTILS\DIRP.EXE
C:\UTILS\DISKEDIT.COM
.
.
.
etc.
Lower Case - /L
---------------
This switch simply displays all the program names in lower case instead of
the default of upper-case
Create manual - /MAN
--------------------
This will decompress this manual (DIRP.DOC) to the current directory.
Display in new OS/2 format - /N
-------------------------------
This switch changes the format of the information displayed on the screen.
Instead of the usual FAT layout:
FILENAME.EXT FILESIZE DATE TIME
The information is displayed in the new OS/2 format:
DATE TIME FILESIZE EASIZE FILENAME.EXT
The extra field 'EASIZE' shows the number of bytes of extended attributes
associated with that program.
Extended attributes (EAs) are only available under OS/2. They allow programs
to store up to 64K of related data with a program (such as a revision history,
a bitmap to use etc.).
This switch will still work under normal DOS, however, the EASIZE field will
always show 0.
If DIRP is run in a Virtual Dos Machine (VDM) under OS/2, the EASIZE field
will show the correct value.
Sort Program information - /O
-----------------------------
This switch allows you to sort the program information on particular fields.
The switch is followed by one or more options:
N Sort on program name (A - Z)
E Sort on program extension (A - Z)
S Sort on program size (smallest first)
D Sort on program date and time (oldest first)
As with the /A switch, preceding with a hyphen can be used to invert the
meaning.
If the 'O' is preceded with a hyphen, the program names are displayed
unsorted.
If any of the options are preceded by a hyphen, the order is inverted.
That is:
-N Sort on program name (Z - A)
-E Sort on program extension (Z - A)
-S Sort on program size (largest first)
-D Sort on program date and time (newest first)
The order in which the options appear *does* make a difference. The program
details are sorted in the order in which the options appear. So, /OSN
would first sort the information on size. If any programs had exactly the
same size, those programs would then be sorted on their names.
Pause - /P
----------
This switch causes DIRP to pause after each screenful of information has been
displayed. DIRP will automatically adjust to the number of rows on the
screen.
Display .LONGNAME extended attribute - /R
-----------------------------------------
This switch is only functional when running in a Virtual Dos Machine under
OS/2. The .LONGNAME extended attribute is usually created when a file with
a long filename is copied to a file system (such as FAT) which doesn't
support long filenames. The filename is converted to something which *can*
be stored, and then a .LONGNAME extended attribute is created which holds the
full length filename.
See the description of the /N parameter for an explanation of extended
attributes.
Recurse into sub-directories - /S
---------------------------------
This switch will display all the programs matching the filespec given on
the drive and directory specified (or the current if none given) and also
all sub-directories below.
After each directory, a one line summary is given which specifies the
number of programs in that directory and the number of bytes used.
Once the last directory has been displayed, a final summary is given which
shows the total number of programs displayed, and the total number of bytes
used, along with the number of bytes free on the drive
Wide Format - /W
----------------
This causes the program names to be displayed across the screen. No other
information is displayed with each filename. DIRP will automatically adjust
the number of columns to fill the screen.
-----------------------------
Due to the fact that the filenames must be first stored in memory (for
possible sorting), a limit is created on the number of filenames that can be
sorted. This limit is just under 3000 program details.
In the unlikely event that a directory has more programs than there is space
for, DIRP will load the as many program details in as it can, sort them, print
them and then get the next set of program details and repeat until there are
no more programs.
Note that this limit is for each directory. When the /S switch is used to
recurse into sub-directories, each directory has this limit, rather than the
limit including all sub-directories.
-----------------------------
Differences under OS/2
----------------------
The OS/2 portion of the program requires OS/2 v2.0 or above to run (I have
tried it on v2.1, 2.11 and Warp). It is a 32-bit program and therefore
requires a 386 or better (but since OS/2 v2.0 and above require a 386 or
better, this isn't a problem!)
All files with the .CMD (similar to batch files) extension are recognised.
Also, normal DOS batch files (*.BAT) are still displayed. Although they
*aren't* OS/2 programs, they *can* be run from the OS/2 command line.
The OS/2 portion will accept long filenames on the command line (using the
normal convention of double-quotes for filespecs containing special
characters). It also displays long filenames on the screen.
The /R (display .LONGNAME EA) is not available under OS/2. This is purely to
stay consistent with the normal DIR command. If enough people want it under
OS/2, I'll add it.
The limit of around 3000 program details doesn't really apply. There *is* a
limit, but it will vary depending on the lengths of the program names
retrieved. At the very minimum, you should get just under 4000 program
details (and that's with each program name 255 characters long!)
-----------------------------
I retain the copyright on the DIRP program and documentation. However, you
may distribute them as much as you like under the following conditions:
i) The copyright statement in the program or documentation must not be
changed.
ii) The program and document file must not be changed in any way.
iii) If the program is distributed with any other package (excluding
shareware/freeware CDs, disks etc.), a credit must be given to me
either on the packaging or in the program itself.
The credit must be at least:
'DIRP v2.02 Copyright 1995 Richard Hulme All rights reserved'
iv) The author is not liable for any damage, financial or otherwise,
caused by the use of this program.
If this program is distributed on a shareware/public domain disk (or CD-ROM),
I would appreciate a short message just to let me know, so I can see how far
my program is getting. I would also appreciate a message from anyone who
finds this program useful - my biggest reward is seeing that the time I have
spent on this program has been worthwhile.
DIRP should work with all versions of DOS above version 3. As far as I am
aware, I have not used any calls that were unavailable in this version.
Since I am a poor student, and I've put a lot of time and effort into this
program, I have decided to release this program as BeggarWare (yes, another
xxxWare!). That is, if you feel you want to pay for this program, send me
however much you feel like sending. All monies sent should be in pounds
sterling (whether cheque/PO etc) to the address below.
Contacting the author:
SnailMail: Fido Netmail:
Richard Hulme Richard Hulme 2:250/109.10
14 Rushyfield Crescent, Boss BBS:Kneptune BBS (+44) 161 777 8088
Romiley,
Stockport, Internet:
Cheshire. cm3bcrph@bs47a.staffs.ac.uk
SK6 4LG
England
I would appreciate reports of any bugs you find. As far as I know, there are
no bugs in DIRP, but it is impossible to try it out on all the possible
hardware combinations. Please give as much detail as possible, e.g what
switches you were using at the time, any TSRs loaded, register dumps if under
OS/2, version of operating system etc.
Revision history
----------------
v2.02 Bug fix.
Very obscure - Under OS/2, any directories starting with a period
would not be checked when recursing sub-directories - fixed.
Minor documentation changes.
v2.01 Bug fix.
Problem with sorting on dates in DOS version - fixed
Problem with recursing sub-dirs on a networked drive under OS/2
(Lantastic particularly, unsure about Lan Manager) - fixed.
Recursing sub-directories on a Lantastic for OS/2 drive in an OS/2
session takes quite a while. This is not (as far as I can tell) my
fault. Lantastic is returning more information than I asked for and
so I have to spend time syphoning off the information I *do* want.
v2.0 Brand new version which can be run under OS/2 v2.x+ or normal DOS.
Now requires to be run under at least v3.00 of DOS (not a problem
for most, I guess!)
Added National Language Support for times and dates.
Added support for wildcards in filespec.
Added support for nearly all the normal DIR switches.
Added built-in manual.
v1.2 Fixed problems with some CD-ROM drives and made the program a little
more OS/2 friendly (removed some undocumented calls).
v1.1 Fixed problems when redirecting the output
v1.0 First version of DIRP
DIRP v2.02 Copyright 1995 Richard Hulme All rights reserved