Dec 232017
 
Excellent disk catalog program. Reads archive files (ARC, ZIP, etc). Full TP5+ source code is included.
File PIBCAT17.ZIP from The Programmer’s Corner in
Category Pascal Source Code
Excellent disk catalog program. Reads archive files (ARC, ZIP, etc). Full TP5+ source code is included.
File Name File Size Zip Size Zip Type
MAKEPCAT.BAT 55 45 deflated
PIBCAT.DOC 21038 7312 deflated
PIBCAT.EXE 20130 19566 deflated
PIBCAT.GLO 8624 2110 deflated
PIBCAT.PAS 11256 2419 deflated
PIBCATA.PAS 14053 2571 deflated
PIBCATD.PAS 16761 3193 deflated
PIBCATK.PAS 19483 3011 deflated
PIBCATL.PAS 12430 2573 deflated
PIBCATM.PAS 10285 2044 deflated
PIBCATS1.PAS 36139 4597 deflated
PIBCATS2.PAS 30840 4723 deflated
PIBCATS3.PAS 43026 6906 deflated
PIBCATS4.PAS 25353 3999 deflated
PIBCATY.PAS 11808 2190 deflated
PIBCATZ.PAS 19811 3509 deflated

Download File PIBCAT17.ZIP Here

Contents of the PIBCAT.DOC file


Introduction
============

PIBCAT.COM is a disk-cataloguing program. It lists all files in all
subdirectories on a given disk, and also lists the entries in library files
of the .ARC, .LBR, .LZH, .LZS, .MD, .PAK, .ZOO, and .ZIP formats. You may
provide a match criterion for files, and you may suppress the library files
content listing.

The complete source code for PibCat is also available. PibCat is written
in Turbo Pascal v5.0.


System requirements
===================

IBM PC or compatible under MS DOS or PC DOS v2.0 or higher with
at least 128K of RAM. The more RAM available, the greater the
number of files which can be processed.


Restrictions on use
===================

I hereby contribute the entire PibCat program and source to the public
domain. As a result, there are no restrictions on what you can do
with this program or code. However, as a matter of courtesy, I ask that
you give me credit if you use any part of this code in developing other
software, and I STRONGLY urge you to release the source code for such
projects to the public domain so that all of us can benefit.

If you make any nifty changes or enhancements to PibCat itself, PLEASE
upload the changes so all of us can profit by them.

Note that System Enhancements Associates (SEA) regards ARC as their trademark.
Should you wish to use the code in PibCat, that reads the directory of
ARC files, in your own program, I suggest you contact SEA for licensing
details and restrictions. I WILL NOT ACCEPT any responsibility for any
legal problems that may arise as a result of the use or misuse of the ARC
processing code contained in PibCat. I do not have any agreement myself
with SEA; SEA has indicated that public domain programs may process
.ARC files without any restrictions.


Liability
=========

PibCat and its related source code is distributed as-is. I, Philip R. Burns,
the author, disclaim all warranties, expressed or implied. I will not assume
any liability for damages either from the direct use of this product or as
a consequence of the use of this product.


Files in Release
================

The following files comprise the complete PibCat v1.7 release:

PIBCAT.DOC -- The document file which you're reading now
PIBCAT.EXE -- The executable version of PibCat

MAKEPCAT.BAT -- Batch file which recompiles PibCat when executed
PIBCAT.GLO -- Global definitions for PibCat
PIBCAT.PAS -- Main program for PibCat
PIBCATA.PAS -- ARC/PAK processing code
PIBCATD.PAS -- DWC processing code
PIBCATK.PAS -- ZIP processing code
PIBCATL.PAS -- LBR processing code
PIBCATM.PAS -- MD processing code
PIBCATY.PAS -- LZH/LZS processing code
PIBCATS1.PAS -- Subroutines for PibCat, part 1
PIBCATS2.PAS -- Subroutines for PibCat, part 2
PIBCATS3.PAS -- Subroutines for PibCat, part 3
PIBCATS4.PAS -- Subroutines for PibCat, part 4
PIBCATZ.PAS -- ZOO processing code

PibCat is written in Turbo Pascal v5.0.


Usage
=====

At the DOS prompt, type

PIBCAT

where the are as follows:

PIBCAT v /c /e=filespec /f=filespec /i=indent /l /m=margin /n
/o=filename /p=pagesize /t=timezone /x /2

v volume (drive letter) to catalog
(default is current drive)
If given as ?, this text is displayed.

/a Requests that PibCat output be appended to
the file specified by "/o=". Default is to
overwrite the the output file.

/c=format Produce condensed listing suitable for
input to a database manager or sorting program.
Two formats are available: a columnar format
specified as "/c=column" or a comma-delimited
format specified as "/c=comma". Specifying
"/c" without a format produces the columnar
format. This option overrides all other
formatting options.

/e=filespec DOS file spec to match for entries contained
in library files (default is *.* -- list all entries).
The match is not case sensitive.

/f=filespec DOS file spec to match when listing
(default is *.* -- list all files)

/i=indent # columns to space for library file entries
(default is 0)

/l display long file names in .ZOO, .LZH, .LZS, .MD, and
.ZIP files, and add subdirectory name for .ARC files
(default is to display short file names only)

/m=margin left margin to leave (default is 0)

/n expand library file contents after
displaying subdirectory contents rather than
immediately following the file name
(default is to list contents immediately.)

/o=filename write catalog listing to file "filename"
(default is "CATALOG.LIS")

/p=pagesize paginate listing using "pagesize" lines
(default is no pagination)

/s=filename write status information to file "filename"
(default is DOS standard output = display)

/t=timezone number of hours local time lags/leads Greenwich
Mean Time (default is 7 hours)

/x don't list library file contents
(default is to list library file contents)

/2 Opens files without SHARE for DOS v2.x compatibility
(default is to open files with share for DOS v3.1
and above)


Aborting
========

Hit Break to abort catalog listing.


Output
======

For each selected file, the file name, size in bytes, and time
and date of creation are displayed. The files are displayed in
sorted order by name. All subdirectories of each directory
are searched and listed automatically. By default, a non-paginated
listing is written to CATALOG.LIS. Use "/p=" to get a paginated
listing (each page has a page number and is separated from the
previous page by an Ascii form-feed character (^L) ).

The "/c" parameter requests output consisting of one line for each file
and (optionally) each entry in library files. This output style is
suitable for use as input to sorting programs and database managers.
Two formats are available:

/c=column: the items appear in fixed columns as indicated below:

Columns Contents
======= ========

1 - 12 File name
14 - 22 File size in bytes
24 - 31 Date in YY/MM/DD format
33 - 37 Time in 24 hour HH:MM format
39 - 50 Library Name (if file is member of a library)
52 - 63 Volume label
65 - 130 Path (without trailing file name)

/c=comma: the items are formatted as above, but a comma appears
in columns 13, 23, 32, 38, 51, and 64 to separate the items.

If a file is a member of a library, then the path is that of the library
file itself, NOT any path stored in the library.

The same file name, size, and time/date information is presented
for members of library files like .ARC, .LBR, .LZH, .LZS, .MD, .PAK, .ZIP,
and .ZOO files. The file names within library files NOT sorted by PibCat.
However, many of these library files are created with names in sorted order
anyway.

For .LBR files, the time and date of the last update for each member,
not the original creation time and date, are displayed. Some .LBR
files do not record creation or update times, and in that case, the
time/date fields are not displayed.

For .ZOO files, deleted entries which still exist in the .ZOO file
will be marked as "(deleted)" in the output listing. Deleted entries
are not included in the totals for files within libraries. Note that
the file names in .ZOO files are stored in LOWER case; PibCat DOES NOT
map these names to upper case in the listing file.

.LZH, .LZS, .MD, .ZIP, and .ZOO files can store long file names as well
as short file names. By default, the file names displayed are the "short"
names and do not include path names. To see the complete file name including
path, specify the "/l" option. The extended name is listed to the right
of the file creation date, and thus may extend past the usual printing
column. If a .ZOO file entry is marked as deleted, then the long name
for that file will not be displayed.

Some programs (PAK16.EXE, for example) produce files with a .ARC-compatible
directory structure. PibCat therefore will try to process .PAK files as
.ARC files.

SEA's ARC600.EXE and later programs allow for storing of the subdirectory
name and also a long file name. At this time, PibCat will display the
subdirectory names when "/l" is specified, but the PibCat does NOT display
any long file names.


A Note About Dates in DWC
=========================

Dean Cooper's excellent DWC program, which creates .DWC libraries, stores
file creation/modification dates and times in Unix format: the number of
seconds elapsed from 0:00 GMT (Greenwich Mean Time) on January 1, 1970 to
the creation/modification time of the file. This was to allow file times
and dates to be adjusted for any time zone.

Unfortunately, DWC is compiled with Microsoft C, which has the astonishing
and brain-damaged gall to assume that the local time zone is the U.S.
Pacific time zone (!). This means that the file dates and times in the
.DWC file are stored as if local time were Pacific time. Microsoft provides
the TZ= environment variable to set the local time zone correctly.
Unfortunately, many users of DWC do not set the TZ= environment variable
correctly, and DWC does not store the current time zone in the .DWC library
itself. This makes it nearly impossible to get the file dates and times
correct when moving a .DWC file from one machine to another.

PibCat tries to circumvent this problem by subtracting seven or eight hours
from the time stamp of each file as given in the .DWC file. (The difference
between seven and eight depends upon whether Microsoft thinks daylight savings
time or standard time is in effect.)

Alternatively, if you know the hour value specified in the TZ= environment
variable when the .DWC file was created, you can specify that hour value
to PibCat using the /t=timezone parameter. Time zones which lag
GMT are entered as positive numbers; time zones which lead GMT are entered as
negative numbers. The hour value you specify will be used to adjust the
file times rather than the default of Pacific time.

PibCat uses the same assumptions as Microsoft about what days are considered
daylight savings time and standard time: daylight savings time is in effect
from 3 AM on the first sunday in April, to 1 AM on the last Sunday in October.
Standard time is in effect otherwise. If you do not want PibCat to adjust
times using these standard time/daylight savings time dates, then append
an 'A' to the number of hours you specify in /t=.

For example, if you know that the /TZ= string originally specified Eastern
time:

SET TZ=est5edt

then you can invoke PibCat with the following /t parameter:

PIBCAT /t=5

This will adjust dates in .DWC files by five hours for days covered by
standard time; days covered by daylight savings time will be adjusted by
six hours.

If you want the adjustment to always be five hours regardless of daylight
savings or standard time, then specify:

PIBCAT /t=5A

If you want to know more about the TZ= environment variable, consult the
Microsoft C Run-Time Library Reference manual.


A Note About Zip Files
======================

PibCat does not handle .ZIP files which span more than one diskette.
Also, PibCat only reports entries based upon the central file directory,
not the scattered directory entries.


If you get "Cannot open file" messages for library files
========================================================

For DOS 3.1 and above, PibCat opens library files for reading with an
access mode type of 64. The output file is opened with an access mode
type of 66. These access modes appear to be good choices for most
networks, SHARE, and so on. However, they may not work for all systems.
If you receive "Cannot open file xxxx.yyy" for all library files (.ARC,
.ZIP, etc.) then chances are you need to turn off the share compatibility
by specifying the "/2" parameter.

For versions of DOS prior to v3.1, or when the "/2" parameter is specified,
PibCat uses a read access mode type of 0 and a write access mode of 2.


Examples of PibCat Use
======================

To get abbreviated help:

PIBCAT ?

To catalog the currently logged disk:

PIBCAT

To catalog disk C:

PIBCAT C

The output goes to file CATALOG.LIS by default. To specify an alternate
output file called MYDIR.LIS:

PIBCAT C /O=MYDIR.LIS

To select a match criterion:

PIBCAT C /F=*.bat ==> only list .BAT files
PIBCAT C /F=\bozo ==> only list files in C:\bozo\ and its
subdirectories
PIBCAT /F=*.ZOO /E=*.PAS ==> List only .ZOO files and any .PAS files
contained in those .ZOO files
PIBCAT /E=*.C?M ==> List all files, but only entries like
*.C?M (*.COM, *.CQM, etc.) in library files.

To get a paginated listing:

PIBCAT /P=60 ==> Paginated listing assuming 60 lines per page
(Form feeds separate pages)

To get the listing indented (perhaps for binding):

PIBCAT /M=10 ==> Indent listing file by 10 columns

To indent the library entry listings further than the regular directory
listings:

PIBCAT /I=5 ==> Indent library listings 5 columns further
to the right than regular directory listings

To prevent Pibcat from listing the contents of library files:

PIBCAT /X ==> No expansion of library files

To get library file contents listing after displaying the subdirectory
entries (as in PibCat v1.0):

PIBCAT /N ==> List contents of library files after all
file names for a given subdirectory

Produce a file catalog suitable for input to a database manager:

PIBCAT /C ==> No expansion of library files

Turn off share mode:

PIBCAT /2 ==> Files not opened in share mode.

Of course the various parameters can be used together.


Recompiling the source
======================

Extract all the source files to a working directory, and then execute
the MAKEPCAT.BAT to recompile PibCat. You will need Turbo Pascal v5.0.

The PIBCAT.EXE file as distributed has been compressed with Graeme W. McRae's
SCRNCH program. The compressed version of PibCat is about half the size
of the uncompressed version. The compressed PIBCAT.EXE is executed exactly
the same way as the uncompressed version would be; the uncompression is
automatic and is done "on the fly."


Acknowledgments
===============

V1.0
====

The archive search code is based in part on TPARCV.PAS by Michael Quinlan
and ARCV.ASM by Vern Buerg. The library search code is based in part upon
LU.PAS by Steve Freeman. Bob Blacher was very helpful in testing PibCat.

V1.1
====

The idea and code for implementing the '/n'-style expansion of .LBR and
.ARC files was provided by Stephen Falatko. Thank you Stephen! I have
altered the .ARC/.LBR contents display so that .ARC/.LBR entries stand out
better when the contents are displayed as part of the main listing.

Dave Seidman pointed out that MS DOS 2.x bugs prevented proper display
of volume labels. He provided a routine to obtain the correct
volume label for DOS 2.x versions. (Regrettably, the date and time for
labels appears inaccessible using any of the standard functions under
MS DOS 2.x.) I have altered the volume display code to check for the DOS
version, and use Dave's method for obtaining the volume label under DOS 2.x.
The date and time for the label are NOT printed under DOS 2.x.

Several people complained that the /f= match criterion didn't extend to
members of library files. I've added the /e= match criterion in response.

-- Phil Burns
January 30, 1987

V1.2
====

Convert to Turbo v4.0. No specification changes. The new version is
an EXE file, i.e., PIBCAT.EXE.

-- Phil Burns
September 1, 1987

V1.3
====

Minor code revisions to work better with TP4. No specification changes.

-- Phil Burns
April 27, 1988

V1.4
====

Lewis Paper pointed out a couple of bugs in v1.3:

(1) Files marked as "read only" could not be read.

(2) A formatting bug caused by a bad call to DUPL caused
occasional system crashes.

My thanks to Lewis for pointing out the problems. These bugs are
fixed in v1.4.

V1.5
====

Add processing of .DWC, .MD, and .ZOO files. No specification changes.
Now designed to be compiled with Turbo Pascal v5.0.

Previous versions of PibCat limited the total number of files along the
current subdirectory path (not including members of library files) to 2048.
This used to be quite sufficient, since few people had nested subdirectories
such that the total number of files in the nested subdirectories exceeded
2048. Nowadays, larger disks and huge numbers of files are more common, so
the 2048 file limit is too small.

PibCat v1.5 uses all available memory to hold file descriptor entries.
Each file descriptor takes 22 bytes. As an example, this means that over
about 20,000 files can exist along a given path of nested directories with
about 500K of available memory.

PibCat v1.5 opens files in SHARE mode under DOS 3.0 and above. This should
reduce conflicts with networks. The "/2" parameter may be used to force
DOS 2.x compatibility in the choice of file open modes even when DOS v3.1
or above is installed.

There are programs (PAK10, for example) which create files with .ARC file
directory structure but with different extensions. PAK10 uses .PAK, and so
PibCat v1.5 will try to list the contents of a .PAK file as if it were a
.ARC file.

I used Graeme W. McRae's SCRNCH program to reduce the size of the PIBCAT.EXE
file by about 40%. The extra time required to decompress the file when it
begins executing is negligible.

-- Phil Burns
November 7, 1988

V1.6
====

PibCat v1.6 lists the contents of .ZIP files. .ZIP files are created
by the PKWare utilities from Phil Katz. Note that PibCat only uses
the information from the central file directory, not the scattered file
headers. Also, PibCat will not process .ZIP files that span more
than a single disk.

Thanks to Ken Brown for his ZIPV program (written in "C" ) which
demonstrated how to read the central file directory of .ZIP files.

PibCat v1.6 also handles the subdirectory structure headers added to
SEA's ARC program beginning with ARC v6.0.

The new "/c" program parameter causes PibCat to output a condensed listing
suitable as input to other programs such as database managers, sorting
programs, etc.

I've changed the share access modes to 64 for reading files and 66 for
writing files, which hopefully will work on more systems than the
previous choices.

-- Phil Burns
March 2, 1989

V1.6.1
======

Several people reported a rather embarrassing bug in v1.6: PibCat will
not expand entries in library files on disks other than the current
default disk. PibCat v1.6.1 fixes that bug. Sorry folks.

-- Phil Burns
March 15, 1989

V1.7
======

V1.7 of PibCat can list the entries in .LZH files created by the LHARC.EXE
program of Haruyasu Yoshizaki, and the .LZS files created by the LARC.EXE
program of K. Miki. The format of the directory entries in .LZH and .LZS
files is identical.

The "/s=" parameter routes the status listing to a file (the DOS standard
output file is the default).

The "/c=" parameter now allows for both the fixed-column format introduced
with v1.6 of PibCat and a comma-delimited format new to v1.7. Some
commonly used database programs are evidently unable to deal with fixed-field
input. Another example of rampant brain-damage, I guess.

The "/a=" parameter requests PibCat to append to the output file rather
than overwriting it.

-- Phil Burns
April 1, 1989


 December 23, 2017  Add comments

Leave a Reply