home *** CD-ROM | disk | FTP | other *** search
-
-
- ZDIFF v1.3
- The Archive/Directory comparison
-
- Shareware program
- Copyright 1993, Christophe Dubourg
- Date : 16 September 1993
-
- ---*---
-
- Table of contents
-
- 1 ........................Purpose
- 2 ........................ Syntax
- 3 ...................... Features
- 4 .................. How it works
- 5 ........................ Limits
- 6 ....................... Remarks
- 7 .................... Disclaimer
- 8 ..... How to contact the author
-
- ---*---
-
-
-
-
- 1. Purpose :
- ------------
-
- ZDiff is a comparison utility program.
-
- You can compare a pair of archives, or a pair of directories, or
- an archive and a directory. (that's the new of this !)
- You obtain a sorted list of all the files, along with a status
- line, showing the differences, if any.
-
- ■ ZDIFF.EXE is the normal DOS version.
-
- ■ ZDIFFD.EXE is the DPMI hosted version.
- It permits a larger amount of files to be treated. (up to 16380)
-
-
- 2. Syntax :
- -----------
-
- ZDIFF <New Archive/Directory> <Old Archive/Directory>
-
- or
-
- ZDIFF <New Archive/Directory> <Old Archive/Directory> [options] [wildcards]
-
-
- Note : To simplify the following, the archive or directory that
- is compared to an other archive or directory will be called a
- Set of files. There is a NEW set of files, and an OLD set of files.
- (to determine the one that is Newer and the one that is Older,
- for instance).
-
- The <New archive/directory> and <Old archive/directory> parameters
- are needed (not optional).
-
- The order in which you specify the New/Old pair is important.
- It will make the difference between a 'Deleted' file or 'Inserted'
- file, or a 'Newer' and 'Older', or 'Bigger' and 'Smaller'.
- (In fact, it will determine the output result)
-
-
- The NEW set of files must be specified first.
- ---------------------------------------------
-
-
- Then, you may specify wildcards if you need.
-
- a. Wildcards
-
- The wildcards may be used to restrict the files compared inside
- the directory or archive. (for both the new and old sets, because
- it would be unlogical to have two different wildcards).
- The DOS standard wildcards are allowed.
-
- b. Options
-
- The options may be specified anywhere on the command line, and are
- not case sensitive. The options are :
-
- /b : Batch output.
-
- Only the file names are output to standard output.
- You may re-use the list as input with an other program.
-
- /c : Country flag override.
-
- If the dates in the ZIP files are not well recognized, you may
- use this option to force the date format to use while reading
- ZIP files :
-
- /C0 - USA date format. (MM/DD/YY)
- /C1 - EUROPEAN date format. (DD/MM/YY)
- /C2 - JAPANESE date format. (YY/MM/DD)
-
- /d : Differences only.
-
- Once the two sets of files are compared, the output will only show
- the files that are different in the 2 sets.
- (ANY difference : date, size, crc, name...)
- By default, all the files of the two sets are displayed.
-
- /h : Help !
-
- This display more help screens, and a copyright screen.
-
- /m : Matching files only.
-
- The output will only show the files that are BOTH in the NEW and
- the OLD set of files. Files that are only in the NEW set or only
- in the OLD set (i.e., Deleted or Inserted files) will not be
- shown.
-
- /n : No Path in names
-
- With this option, you can compare a directory tree with a single
- directory. Useful to compare a ZIP file that have a directory tree
- stored inside of it, and a directory that contains all the files
- without subdirectories.
-
- Example : to compare to directories, one containing the 'organized'
- procuct, and one containing the 'development' version, like :
-
- New directory : DEV\*.*
-
- Old? directory : CUT\DISK1\*.*
- CUT\DISK2\*.*
- CUT\DISK3\*.* etc...
-
- You can compare these 2 directories with the following command :
-
- ZDIFF /r /n DEV CUT
-
- /p : Pause.
-
- With this option, ZDiff will prompt you before reading each set
- of file. The purpose of this is essentially while using floppies.
- For example, if you need to compare two sets that are on two
- different floppies that have the same format, you'll have to insert
- one disk, read the files from it, and then the second disk.
- Maybe, you could compare 2 removable hard disks, or a hard disk
- and an archive, or whatever you want.
-
- /q : Quick scan.
-
- If a directory is involved in comparison, this permits to skip the
- CRC calculation on each file of this directory, in order to
- speed up the process. Of course, use this option with caution,
- since the comparison is made only with TimeStamp and Size !
- (two files can have the same date and time of last modification,
- same size, and be binary different : using this option, they will be
- marked as 'Same').
- However, if the timestamp or size is different, 'Differs' will be
- displayed.
-
- /r : Recurse directories.
-
- By default, the subdirectories are not searched, either in the
- archive or the directory file structure. (to save time).
- This switch allows the comparison of the full tree of directories.
- Note : if you don't specify the -r option, the filenames that
- contains a path in the archives are not treated at all.
- A warning is displayed if a path is found in an archive, and you
- have not used the -r option.
-
- /v : Verbose output.
-
- This option causes a status to be output at the end of comparison.
- This status report shows the number of files that are :
-
- - Identical
- - Different
- - Newer
- - Older
- - Bigger
- - Smaller
- - Inserted
- - Deleted
-
- It may give an idea of the amount of differences between the two
- sets, without having to analyze the whole output.
-
- /z : Zpecial messages.
-
- Troubleshooting mode option - display more information while running
- like Country code detected, date used, Zip version...
- It may help if something seems to go wrong (with date format
- detection, for example).
- Please note that using the DPMI version of ZDiff with the RTM
- DPMI server, the Country Code number will be 112, which is false.
- This is because the DOS function used is not supported in this
- DPMI host ; however this doesn't affect the DATE FORMAT detection.
- (See the /C option to override the Date format detection)
-
-
- 3. Features :
- -------------
- Since this is a comparison program, you will probably want to know
- how it compares the two sets of files :
-
- The keys of comparison are :
-
- Name : If two names of the sets don't match, either one is new or one is
- deleted, depending on the order you specified for the comparison.
- if the -r option is specified, the full filename must match.
-
- Once two files are found in both the 2 sets, a more precise
- comparison occurs. The keys for comparison between two files that
- have the same name are :
-
- CRC : A 32 bit CRC calculation is made on the files to know if they are
- absolutely identical or not.
- Note : if one of the files is an archive of type LZH, LHA, ARC or
- ZOO, then a 16 bits calculation is done instead, to match the CRC
- that these archives use.
- If the Quick option is set, and one of the 2 sets is a directory,
- no CRC calculation occurs, and files are assumed binary identical.
-
- Date : To know which one is the oldest file, or the newest.
-
- Size : To know which one is the biggest file, or the smallest.
-
-
- 4. How it works
- ---------------
- To compare two directories, you won't need nothing but ZDIFF.EXE.
- But to compare two archives, or an archive and a directory, you'll
- need the correct unarchiver in your PATH, to access the archives
- you have specified.
-
- The program supports all the current archive formats that are
- commonly used and that I am aware of :
-
- ZIP, ARJ, LHA, LZH, PAK, ZOO, ARC.
-
- The needed unarchiver, for each extension is :
-
- *.ZIP PKUNZIP.EXE (v1.10 or v2.04)
-
- *.ARJ ARJ.EXE (v2.30)
-
- *.LHA \
- *.LZH - LHA.EXE (v2.12)
- *.PAK /
-
- *.ZOO ZOO.EXE (v2.1)
-
- *.ARC PKUNPAK.EXE (v3.61)
-
- (each of these can be easily found on many BBS)
-
- Now, here how it works :
- The program first checks if the archive or directory that you
- specified exists. (to prevent an error after some precious seconds
- of calculation). At this points, it decides if a 32 bit or 16 bit
- calculation will occur (or no crc, if Quick mode is set).
- Then, it analyze the NEW set, and then the OLD set.
- Two choices, concerning each set of file :
-
- a. If it's an archive:
-
- The unarchiver is called, to obtain a list of each file in the
- archive, along with the date, crc, size, and so on.
- This list is saved in a temporary file.
- (Using the TEMP environment variable if available)
- Then, the temporary file is opened, and scanned for each file in it.
- Since all the informations are already calculated by the unarchiver,
- there's nothing to compute (the crc is already there).
-
- If this is NEW files, each file name is stored in memory, along with
- all the informations needed to compare later.
- If this is OLD files, a search is made in memory, to see if the file
- already exists in the NEW directory. If yes, the comparison occurs,
- and the status is updated accordingly. If not, the file information
- is simply stored.
-
- b. If it's a directory:
-
- The directory is scanned, and all the files are opened, to obtain
- the date, time, size, and a CRC calculation occurs.
- (except if the Quick mode is set).
- Each file entry is then treated like the archive file entry :
- if NEW, then the information is just stored. If OLD, the file is
- searched in memory, and then either added or updated in the list.
-
-
- After all the files have been read (the NEW set and the OLD set of
- files), the sorted list is sent to standard output.
- Since you can redirect standard output, you could use this facility
- to pipe the output to a finder program (FIND), or a viewer program
- (LIST), or any filter program of your choice.
-
-
- Here are some examples :
-
- 1. ZDIFF NEWARC.ZIP OLDARC.ARJ | more
-
- This display the output via DOS's more command.
- (if the archive contains sub-dirs, they are not included,
- since no -r parameter is there - instead, you'll obtain a
- warning while running ZDiff).
-
- 2. ZDIFF /r NEWARC.ZIP OLDDIR *.DOC | FIND "Newer" | LIST /s
-
- This display, via the LIST viewer, all the NEW files in
- NEWARC.ZIP, compared to OLDDIR directory.
- Subdirectories are scanned, too.
- Only the .DOC files are processed.
-
- 3. ZDIFF NEWZIP.ZIP . -r -q -c1
-
- This output on screen the differences between the archive
- NEWZIP.ZIP and the current directory, and the subdirectories.
- A Quick scan (-q) of directories will be made (no CRC), so
- the comparison will be made on date, time and size only.
- The date format used by PKUNZIP on this machine (-c) is the
- EUROPEAN date format (DD/MM/YY).
-
- 4. ZDIFF -v . -r OLDARC.LHA /d /q -m
-
- This output on screen the differences between the current
- directory and the archive OLDARC.LHA. Subdirs are scanned also.
- A Verbose (-v) status is displayed at end of comparison.
- Only the differences are shown (/d), and no CRC is calculated.
- Only the matching files of the two sets (-m) are displayed.
-
-
- 5. Limits :
- -----------
-
- ■ ZDIFF.EXE :
- All the files informations are stored in DOS memory. (no EMS)
- It permits between about 5500 to 9900 files to be stored, depending
- on the path length - this is much enough for everyday use,
- I guess.
-
- ■ ZDIFFD.EXE :
- All the files informations are stored in the GLOBAL memory. (DPMI)
- So, you can virtually store as many files that you have
- memory free, up to 16380 files at one time in memory.
- You need Windows or any other DPMI server, like Borland's RTM.EXE
- and DPMI16BI.OVL.
- Note : Borland DPMI server can be found on Compuserve :
- GO BORFORUMS, then choose 'Borland Pascal forum'.
- Then, choose the 'From Borland' library section, and download
- the file called NEWRTM.ZIP.
-
- ■ Note concerning the archives : if the -r option is not specified,
- the files containing a path in their name are not included in the
- comparison. Only the files in the main directory of the archive
- are treated, and only the files in the specified directory are
- specified also.
- However, a warning is displayed if a directory path is found in
- an archive, and you haven't specified the -r option.
-
-
- 6. Remarks
- ----------
- I made my possible to make this program free of bugs, but if ever
- something is wrong with ZDIFF, tell me. I'll fix it ASAP.
-
- Please notice that ZDiff supports international information from DOS,
- since PKUNZIP does. (it concerns the date format, used for
- time comparison, that is different in US than in France, for
- example). The DOS Country information is read for this purpose.
- The 3 date formats that exists are USA, European and Japanese.
- If ever the comparison of dates seems to be wrong in ZDiff,
- you can override (with the /C option) this state of thing, to
- set a date format to use on your machine. See the 'Syntax' section.
-
- Note : if you use the /Z option to display technical information,
- the country information reported by ZDIFFD.EXE will be 112 instead
- of the correct country number, if you use the Borland DPMI RTM ;
- The date format, however, will be correctly detected and used.
- This is because this function is not supported in RTM. The correct
- country number will be correctly obtained, running ZDiffD under
- Windows DPMI.
-
- Since ZDiff writes a few temporary data on your hard disk (in your
- temp directory), you should not reboot while ZDiff is running,
- as this could result in lost sectors. (CHKDSK /F corrects it)
- Just use Ctrl-Break if you want to abort the program.
-
-
- 7. Disclaimer
- -------------
- Even if there is really no possibility for this program to
- damage your data, here is the usual disclaimer message :
-
- As a shareware program, ZDIFF is distributed as-is.
- The author disclaims all warranties, expressed or implied.
- The author will assume no liability for damages either from the
- direct use of this product or as a consequence of it's use.
-
- PKUNZIP, PKUNPAK, ZIP, ARJ, ZOO, PAK, LZH, LHARC, LHA are
- copyrighted by their respective authors.
-
-
- 8. How to contact the author
- ----------------------------
- If you like this program, and plan to use it, you may try it
- during a 21 days period, after what I would appreciate a donation
- from you.
- I develop many tools for my own use, (this one helps me a lot!)
- and I would like to share what I do with others.
- If users gives me money, it will be a proof that my tools are
- useful : in this case, I'll spend more time to update them, and
- adding features.
-
- Of course, you can send what you want, but I would like to precise
- that when I want to have a Dollar check paid in my bank, it costs
- me $11 (I live in France). So, if you want to send money, please
- consider this, and send more than $11 ! ($20 would be good)
-
- An other option is sending cash notes in an enveloppe. If you
- can do that, please send about $10 or more.
-
- ** Thanks in advance. **
-
- -------------------------------------------------
- HERE IS MY ADDRESS Christophe Dubourg
- FOR MAIL, CHECKS, or 23, rue Victor Hugo
- CASH : 78370 PLAISIR
- FRANCE
- -------------------------------------------------
-
-
- --> Even if you don't send money, please feel free to send me your
- remarks, suggestions, and specific problems encountered with
- this program.
-
- It will be a pleasure to read your mail and to answer it !
-
- Don't hesitate to contact me, at the following addresses :
-
- ---------------------------------------------------------------
- Compuserve : 73233,1412 (Christophe Dubourg)
- or 73233,1412@compuserve.com
-
- MCI Mail : CDUBOURG (453-6013)
- or cdubourg@mcimail.com
-
- Internet : cdubourg@borland.com
-
- At home (paper Mail) : Christophe Dubourg
- 23, rue Victor Hugo
- 78370 PLAISIR
- FRANCE
- ---------------------------------------------------------------
-
- Thanks for using ZDiff, I hope it helps. //ChD
-
-