home *** CD-ROM | disk | FTP | other *** search
- ZDIR.COM - A ZIP utility from Toad Hall 27 Jan 93
- v1.8
-
- Usage: ZDIR [-v] filename[.ZIP] [member.typ] [-v | -m] [>output]
- where [-v] verbose display (/V works also)
- [-m] monosyllabic display (yeah, /M too)
- (Note -v and -m are mutually exclusive!)
- filename name of target zip file(s) (wildcards ok)
- [.ZIP] optional file type (forced to .ZIP anyway)
- [member.typ] optional ambiguous ZIP member name
- (generalized wildcards ok)
- [>output] optional output redirection (default: CON:)
-
- Results:
-
- In the default ('wide') mode, ZDIR outputs a 3-column listing of
- the members of the target .ZIP file(s), to include compressed and
- uncompressed file sizes (in Kb). Short, sweet, to the point.
-
- If you include the -V verbose switch, ZDIR will output a more
- detailed report (with one member file per line), and ZIP file
- comments (if present). ZIP member sizes and file count will
- be totalled and output, and the overall totals (for all ZIP
- files processed if you designate more than one) will also be output.
-
- If you use -M instead, you'll get just one file per name,
- complete with path et al., as stored in the Zip file. No sizes,
- no dates; may be useful for piping into programmes. Beware of
- the header lines and the Zip comment, though.
-
- If a member.typ pattern is used, possibly containing wildcards,
- then only members matching that pattern are listed. The pattern
- may be of the form 'a*b?c', meaning 'any string between a and b
- is ok, but b and c must be present with exactly one character
- between them'. (The way you always wanted DOS to behave but were
- afraid to ask Bill Gates for.)
-
- C:>ZDIR A:* will list contents of all .ZIP files
- on drive A:
- C:\SUBDIR\>zdir * will list contents of all .ZIP files
- in the current drive:\directory
- C:\SUBDIR\>zdir f* will list contents of all .ZIP files
- starting with 'F' in the current drive:\
- directory
- C:\SUBDIR\>zdir f*.* in addition, will try even those files
- with a type other than '.ZIP'.
- C:>ZDIR * *.asm will look in all .ZIP files in current
- drive:\directory, and list member files
- that have an '.ASM' file type.
- C:>ZDIR -v * *.asm same thing, but verbose display
- C:>ZDIR d:\foo\f* *.COM will look in all .ZIP files starting with
- 'F' in D:\FOO\, and list member files
- whose names begin with 'C' and have a
- '.COM' file type.
- C:>ZDIR \asm\zdir17 zdir1?.asm
- will look in ZDIR17.ZIP in \ASM\, and list
- member files that start with 'ZDIR1',
- then any single character, and file type
- '.ASM'.
- C:>ZDIR ..\zdir17 *o?.?
- will look in ZDIR17.ZIP in the parent
- directory, and list all files that have
- an 'O' as their second-to-last character
- and a type of length 1.
- Limitations:
-
- None reported.
-
-
- Notes:
-
- You'll notice ZDIR's display is more like the other file
- compressors out there. (I don't have legal problems with SEA
- to worry about .. so WHAT if it resembles their ARC's display!)
- I WANT the file name at screen left .. and am NOT concerned at
- this time about extended file names .. so ZDIR's display is
- NOT like PKZIP's.
-
- Plans: Add DIR-like functioning with compatible switches:
-
- ZDIR Produce a listing of the target .ZIP file
- contents identical to a DIR listing.
- Member dates, times, byte sizes (uncompressed).
-
- ZDIR -W Just like a DIR /W (wide) listing. No sizes,
- dates, etc.
-
- Eventually a "ls"-compatible utility, providing all the functionality
- and switches of the Unix-compatible ls utility.
-
- Add ARC/PAK display capability as well as ZIP files.
-
- Contemplating a non-DOS output of the ZIP file comments
- (to eliminate any chance of ANSI command sequences turning out
- to be keyboard macros AKA viri). However, then the comments
- wouldn't go to StdOut anymore .. sigh ..
-
- Credits:
-
- Compliments to the unknown author of ADIR.EXE (snarfed long ago from
- who knows where, no source) for his wildcard functions. (Though NO
- thanks to him for not releasing the source. It was buggy anyway.)
- Watch this space for the upcoming release of an improved ADIR
- (with assembly language source, of course).
-
- Thanks to PKWARE for the details on the ZIP directory structure.
-
- Thanks to Gunter Rademacher for the Fortran source of a non-recursive
- generalized wildcard matcher.
-
- Constraints:
- None. Released to the public domain.
-
- David P Kirschbaum
- Toad Hall
- kirsch@sesi.com
-
- Significant version changes:
-
- v1.8 Minor changes to match PKWARE's V2.07x.
- - Added "Tokenized" and "Deflated" methods.
- - Removed earlier version numbers from comments
- and commented-out code (since it seems to work).
- - To be done: multi-volume :-)
- - Contemplating conflicts with some newcomer whippersnapper
- and his feelthy ZDIR directory shell. Phthththththth.
- We'll let *him* worry about it: we were here first, ayup.
- Toad Hall
-
- v1.7 Another round from Bonn. Ten thousand thanks to TapirSoft
- and Gisbert W. Selke
- - fixed a bug in ZIP file name parsing: wouldn't accept a parent
- dir in path ('..\blah'), nor dirs including .TYPEs (WHO uses those??)
- - leave .TYP of zip file alone if specified on command line; why force
- it to ZIP?? (Assuming the user knows what she does.)
- - David's complaint about missing file name expansion routines pitied
- me; so here's neat parsing, and the way DOS always should have worked:
- 'a*d' will match 'ad' and 'abd' and 'abcd' but not 'a' or 'ab'...;
- 'a?d' will match 'abd' but not 'ad'. Side effect: 'foo*' will
- match 'foo' and 'foo.bar' - period is just an ordinary char.
- This applies to ZIP members only, not to ZIP file names! (Could
- be done easily, though. Too lazy for now. See comments in Find_ZIP.)
-
- v1.6b Toad Hall again
- - GWS's code immediately adopted (great ideas!).
- - Removed old commented-out code (from v1.5, v1.6, v1.6a, etc.)
- - Formal release from Toad Hall as v1.6b.
-
- v1.6a GWS (yeah, hacking away in West Germany's capital village)
- strikes again
- - Cleaning up verbose display:
- Some columns were one off. Also, change name alignment slightly.
- - Added /m ('monosyllabic') command line switch:
- This will show full names, paths'n'all, as stored in the Zip,
- one per line, and nothing else. May be nice for piping into
- other programmes. - Beware of the header lines, though.
-
- v1.6 - v1.4a Changes:
- Gisbert Selke (all the way from Germany, I think) tweaked the
- earlier v1.4 code. (See the v1.4a comments).
- I kept his changes (that I hadn't already added in v1.5 myself),
- incorporating them into the v1.5 code. (Of course, just HAD to tweak
- his changes as well!)
- Nice to see he didn't catch the bugs in v1.4! Makes me feel
- slightly less stupid.
- - Member filenames:
- In verbose output, I'm still considering shifting filenames to the
- right hand side of the screen. That would permit long (path)
- filenames to be displayed/output (with screen wraparound handling
- the weird, extra-long ones). I believe that's why the PKZIP author
- (Katz) formatted his display that way. But the member names on the
- right is NOT convenient to me! Leaving it the original way (member
- file names on the left). Someday, when we decide to display
- file paths as well as names, we'll probably have to do that.
- (Or display paths separately on the right .. or whatever ..
- Whaddya want, outside world? Give me your opinions.)
- - Considering parsing the ZIP file comments for ANSI command
- sequences (to trap those viruses that try to reassign your
- keyboard to delete your hard disk, etc., via a ZIP file
- comment). Not yet.
-
- v1.4a - TapirSoft Gisbert W.Selke: Allow '/' as switch char, for them
- die-hard DOS people like myself. Display rrrrrreal 4-byte CRCs.
- Add text for 'Imploded'.
-
- v1.5 - Added the "implode" compression style to verbose display,
- plus traps for unknown compression types.
- - Added an "E" encryption flag to verbose display.
- - Display shows a "+" (in verbose as well as nonverbose mode)
- if member file names include paths.
- (We are NOT displaying full paths yet.)
- - Squashed some bugs. (See .ASM for details)
-
- v1.4 - Increased the offset (from ZIP file end) where ZDIR starts to
- look for the ZIP central directory. Seems some BBS's are adding
- huge advertising billboards as comments.
-
- v1.3c - Never tested for no cmdline args at all, and the new args
- command line parser went into never-never land! Sloppy testing!
- Fixed, and thanks to FAAR RBBS for alerting me.
-
- v1.3b - 1.3a broke member file testing. Squashed the bugs (harder
- this time) with completely rewritten command line parsing.
- (Donno HOW it got past testing!)
- Now you can put the '-v' verbose switch before or after
- file names and wild cards.
-
- 1.3a - Bumped file end reading up to 256 bytes to insure we can handle
- ZIP files that might have been padded (rounded up to 128 bytes)
- by XMODEM and other unmannerly file transfer systems and utilities.
- - Adding ZIP file comment display.
-
- v1.3 - Adding '-v' verbose display via cmdline switch. Code snarfed from
- my hack at QBARCV.ASM (an ARC/PAK/ZIP lister for QuickBasic and
- RBBS).
-
- v1.2 - Replaced brute force (reading a 5Kb hunk of the file end into a
- buffer and searching for central directory start) with a more
- elegant solution: read in the end directory structure and find
- the file pointers to the central directory there.
-
- v1.1 - I forget.