home *** CD-ROM | disk | FTP | other *** search
/ Amiga Developer CD 2.1 / Amiga Developer CD v2.1.iso / Contributions / Cloanto / Tools / DirDiff / DirDiff.man < prev    next >
Encoding:
Text File  |  1997-10-06  |  24.7 KB  |  581 lines

  1.  
  2.  Cloanto DirDiff v. 5.1
  3.  
  4.  
  5.  1.         Introduction
  6.  
  7.  DirDiff is a powerful tool to scan, compare, synchronize and replicate
  8.  files. It was originally designed for internal use at Cloanto to simplify
  9.  the maintenance of software master disks and for backup management. Over
  10.  the years, new features were implemented, the file comparison engine was
  11.  enhanced and a Workbench interface was added.
  12.  
  13.  
  14.  1.1        What can DirDiff do?
  15.  
  16.  DirDiff allows you to compare (and optionally update) two disks. Several
  17.  options can be set to finely tune this process.
  18.  
  19.  DirDiff allows you to copy some files from hard disk to floppy, then use
  20.  the floppy on another computer (for example at home), and from time to
  21.  time automatically move the files which have changed to whichever medium
  22.  contains the older version.
  23.  
  24.  DirDiff allows you to compare bootable disks against new versions of the
  25.  Amiga Workbench disks. It can selectively compare only the files used in
  26.  both disks, skipping icon files if desired. So you get only messages
  27.  regarding the files that count. If you wish, you can upgrade the system
  28.  files on your work disks in the same process.
  29.  
  30.  When copying tens, or hundreds of Mbytes from one device to another,
  31.  errors are more likely to occur and pass undetected than with normal,
  32.  interactive use. Using DirDiff, at Cloanto we discovered faulty I/O
  33.  configurations which caused only one or two bytes out of 100 million to
  34.  be corrupt. We now always use DirDiff after each step in the preparation
  35.  of master disks, both for floppy disks and for CD-ROMs, to make
  36.  absolutely sure that no errors have occurred. When it finds certain
  37.  errors, DirDiff does an additional check to make sure that the storage
  38.  medium gives consistent results. It even double-checks the RAM locations
  39.  it uses.
  40.  
  41.  DirDiff is an invaluable tool to back-up a hard disk to a slower device,
  42.  such as a magneto-optical disk, because it can copy only the files which
  43.  have changed. Results can be achieved faster and in a less
  44.  resource-consuming way. To make the process bullet-proof, the source
  45.  directory can be locked, and differing files can be forced from hard disk
  46.  to the optical disk even if they have an older date. Files from older
  47.  backups which become unused can be deleted in the process. The combined
  48.  use of these functions can deliver identical copies at a fraction of the
  49.  time a standard "Copy" procedure would normally require.
  50.  
  51.  DirDiff can detect even subtle differences between two items, such as a
  52.  directory renamed from "WBstartup" to "Wbstartup". Before DirDiff reports
  53.  that two directories are identical, it checks not only the contents, but
  54.  also the attribute bits, file comments, dates and exact names of all
  55.  items.
  56.  
  57.  DirDiff can scan a directory or disk and give an electronic signature
  58.  (for example "DD5-A89CE287"), derived from the contents of all files.
  59.  This short code can then be used to refer to a particular disk or product
  60.  release without detailing the entire contents. For example, two distant
  61.  offices which want to verify if they have the same version of a disk can
  62.  execute DirDiff separately, and then check the signature in a phone call
  63.  taking only a few seconds. Or the signature can be used as a reference in
  64.  a licensing agreement, as a confirmation of what is being licensed.
  65.  
  66.  DirDiff includes additional checksum capabilities, and features such as
  67.  clearing of unused blocks on a device (useful when you do not want others
  68.  to "undelete" data on a medium which you considered safe to give away).
  69.  
  70.  
  71.  2.         The user interface
  72.  
  73.  DirDiff can work in two modes: single directory mode and two-directory
  74.  mode. The first mode is mainly a scanning mode. It can be used to check
  75.  the integrity of files (all data is read from beginning to end), and to
  76.  calculate file checksums and a final signature based on the total data.
  77.  
  78.  When working with two directories, DirDiff can perform complex comparison
  79.  and update tasks, while remaining very easy to control. For certain tasks
  80.  (as in the "Lock", "Maximum Priority" and "Delete" modes), the first
  81.  directory is considered the primary, or source directory, and the second
  82.  directory is the destination. The first directory can be locked, so that
  83.  data only flows in one direction. The first directory can also be
  84.  assigned "maximum priority", so that data is transferred from the first
  85.  directory to the second even when files in the first directory appear to
  86.  be older than those in the second. Existing files in the second directory
  87.  can optionally be deleted, if they do not exist in the first directory.
  88.  
  89.  DirDiff can be executed from Workbench or from the Shell. In Workbench
  90.  mode, all options can be set from the program window. Menus allow to do
  91.  additional things such as saving the current settings. The window has a
  92.  status line indicating the current file or action, plus an area showing
  93.  either the settings or the results.
  94.  
  95.  In Shell mode, a help list containing the keywords associated to the
  96.  program settings is displayed whenever the program is executed without
  97.  parameters (that is, just entering "DirDiff" in the Shell). The execution
  98.  results are printed in the Shell, and upon termination DirDiff exits with
  99.  an AmigaDOS return code ("OK", if no errors or unresolved differences
  100.  were found, or "WARN" otherwise), which can be used for conditional
  101.  branches when DirDiff is executed from scripts.
  102.  
  103.  
  104.  2.1        Window Gadgets
  105.  
  106.  The window displayed by DirDiff incorporates standard Amiga gadgets. The
  107.  Window Close gadget on the upper left corner is equivalent to the Quit
  108.  gadget. The Zoom gadget, on the right, allows the user to quickly expand
  109.  the window size to the maximum possible size. The Depth gadget is located
  110.  on the window title bar next to the Zoom gadget. It is used to bring the
  111.  window to the front or back with respect to other windows. DirDiff
  112.  automatically pops the window to the front of other windows when it
  113.  finishes a job.
  114.  
  115.  The bottom of the window contains five gadgets: Run, Pause, Abort,
  116.  Iconify and Quit. Run instructs DirDiff to begin a new processing cycle.
  117.  Pause temporarily halts processing, which can be resumed by pressing the
  118.  same gadget again. Abort concludes processing on the current file and
  119.  suspends further processing. Iconify closes the window (but does not
  120.  interrupt processing). A "DirDiff" icon appears on the Workbench to
  121.  indicate the iconified state. A double-click on the icon reopens the
  122.  window. The Quit gadget closes the window and terminates the program
  123.  (aborting any processing in progress, if necessary).
  124.  
  125.  
  126.  2.2        The Mode Gadget
  127.  
  128.  This gadget toggles between single and dual directory mode. By default
  129.  DirDiff works with two directories. If the same directory is indicated
  130.  twice, DirDiff switches to single-directory mode.
  131.  
  132.  
  133.  2.3        The Path Gadgets
  134.  
  135.  These two text gadgets specify the working directories. Icons can be
  136.  dragged from the Workbench screen and dropped over the gadgets. The small
  137.  gadget to the right of the string gadgets activates a file requester
  138.  which can be used to select the path.
  139.  
  140.  Note: If one of the two devices is much slower than the other, or if it
  141.  has considerably fewer files, and if the processing involves a simple
  142.  comparison and no updates, then DirDiff is faster if the directory with
  143.  fewer files, or a slower device, is indicated as the first directory.
  144.  This is because in the main phase the second directory has to be searched
  145.  for all files found in the first one, and this occurs in an order
  146.  arranged after the first directory.
  147.  
  148.  
  149.  2.3        The Page Gadget
  150.  
  151.  The central area of the program window always contains one of three
  152.  pages: the Settings Page, the Output Page or the Status Page. The Page
  153.  gadget allows the user to cycle through these pages.
  154.  
  155.  
  156.  2.4        The Settings Page
  157.  
  158.  This page contains all options which can be set by the user. A particular
  159.  configuration of options can be saved from the program menus.
  160.  
  161.  
  162.  2.4.1      Dates
  163.  
  164.  By default, whenever DirDiff finds the same file or directory in both the
  165.  first and in the second directory, it also compares the dates. On the
  166.  standard Amiga filing system this date indicates the date of the last
  167.  write to the file or directory (although directory dates are not always
  168.  up-to-date).
  169.  
  170.  If DirDiff if used to compare two directories, and when it is known in
  171.  advance that the files in a directory had their dates modified during an
  172.  incomplete copying process, this option could be disabled in order to
  173.  leave the list of differences more readable, without excessive messages.
  174.  
  175.  The date associated by AmigaDOS to each directory entry is accurate to
  176.  1/50 of a second (although fractions of a second are not indicated by the
  177.  Amiga Workbench, nor by the Shell's List command). Some filing systems
  178.  (e.g. MS-DOS, or ISO 9660 as used for CD-ROMs) and archiving software
  179.  (e.g. LhA) store dates with a slightly different precision than the Amiga
  180.  filing system. So it may happen that when a file is copied to a device
  181.  employing a different filing system, the date of the copy shows a small
  182.  difference (usually less than a second).
  183.  
  184.  The "Dates ± 2 sec" option instructs DirDiff to ignore small differences
  185.  in the file dates, within a range of ± 2 seconds. In Update mode, it also
  186.  informs DirDiff that file dates are not reliable within the ± 2 second
  187.  range.
  188.  
  189.  When this option is disabled, dates are neither compared nor updated,
  190.  unless a file or directory is being updated for a different reason.
  191.  
  192.  Note: It is recommended to always preserve the original file date when
  193.  copying files. This is a piece of information which can give precious
  194.  hints about the history and the current status of the file. In case of
  195.  updates, DirDiff may use these dates to determine which item is older and
  196.  should be overwritten. Unfortunately, by default the Amiga Copy command
  197.  of the Shell changes the date of the destination file. To avoid this,
  198.  Copy should be followed by the CLONE option. At Cloanto, we use a "cp"
  199.  command, which is defined as follows in the S:Shell-Startup file:
  200.  
  201.      Alias cp Copy [] CLONE
  202.  
  203.  
  204.  2.4.2      Attributes
  205.  
  206.  Just as it compares the dates of items found in both directories, DirDiff
  207.  also compares attributes such as the comment associated to that item and
  208.  its status bits (see the Filenote and Protect AmigaDOS commands). Under
  209.  AmigaDOS, matching files could even have slightly different file names,
  210.  because capital and lower case letters are treated as if they were
  211.  equal.
  212.  
  213.  Some or all of these additional attributes could be altered or even lost
  214.  when files are archived or moved to other filing systems. For example,
  215.  most Amiga implementations of the ISO-9660 CD-ROM filing system do not
  216.  represent the original Amiga file comments and attribute bits. In a
  217.  conversion to the MS-DOS filing system, it is possible that all file
  218.  names are automatically converted to capitals.
  219.  
  220.  When this option is disabled, attributes (comments, attribute bits and
  221.  exact names) are neither compared nor updated, unless a file or directory
  222.  is being treated as different for another reason.
  223.  
  224.  
  225.  2.4.3      Icons
  226.  
  227.  DirDiff normally also processes the ".info" files which contain
  228.  information about the Amiga Workbench icons associated to files and
  229.  directories.
  230.  
  231.  This option allows to leave out icon files from this process. This could
  232.  be useful, for example if two disks are known to have similar contents,
  233.  but differing icon positions.
  234.  
  235.  
  236.  2.4.4      Quick
  237.  
  238.  On a reliable medium, it is normally safe to consider that two files
  239.  having the same name, length and date are identical. The Quick option
  240.  allows DirDiff to make this assumption, so that the contents of files
  241.  having the same name, size and date is not analyzed. This is much faster
  242.  than scanning two files from beginning to end. When the dates differ,
  243.  DirDiff scans the files automatically, even if they have the same name
  244.  and length.
  245.  
  246.  It is recommended to disable the Quick option whenever the reliability of
  247.  a medium or of a copying process is questionable. This causes all files
  248.  to be byte-scanned and compared from beginning to end.
  249.  
  250.  
  251.  2.4.5      Couples Only
  252.  
  253.  This option restricts the set of items being processed to those which
  254.  exist in both the first and in the second directory. This is useful
  255.  whenever a medium contains a base set of files which has to be checked
  256.  against an original, plus some additional items which do not need to be
  257.  checked or updated.
  258.  
  259.  Activating this option could be useful, for example, to compare a new
  260.  Workbench disk with the Workbench installed on the computer's hard disk.
  261.  In this case, both the hard disk and the Workbench disk could contain
  262.  items which do not exist in the other directory, and which are not
  263.  relevant for a quick difference check.
  264.  
  265.  
  266.  2.4.6      Update
  267.  
  268.  This option controls the part of DirDiff that not only reads, but also
  269.  writes to the directories being processed. When Update is disabled, no
  270.  writes occur. When Update is active, DirDiff will take actions in order
  271.  to resolve the differences between the two directories. These could be:
  272.  copying the entire file and/or setting the date and other attributes.
  273.  
  274.  Disabling the Update option is also useful to execute a test run of
  275.  DirDiff to see which files would be affected if Update were enabled. If
  276.  the results are acceptable, the Update option can be enabled to run
  277.  DirDiff a second time.
  278.  
  279.  
  280.  2.4.7      Lock Directory 1
  281.  
  282.  This option acts as a "valve", limiting the direction in which the update
  283.  process is allowed to write data. It is normally a reassuring option to
  284.  use when using DirDiff to make backups. In this case, the source
  285.  directory (containing the data to be copied) should be indicated as the
  286.  first directory.
  287.  
  288.  Regardless of the state of this option, older files are never copied over
  289.  newer ones. This is only possible by activating the "Maximum Priority"
  290.  option.
  291.  
  292.  
  293.  2.4.8      Maximum Priority
  294.  
  295.  This is a potentially "dangerous" option. It forces data to be copied
  296.  from the first directory to the second one whenever two items are
  297.  different, even if this means copying an older item over one having a
  298.  more recent date.
  299.  
  300.  The Maximum Priority option only causes file to be copied from the first
  301.  directory to the second, and not vice versa. From this point of view, it
  302.  is similar to "Lock Directory 1", only that it is considerably more
  303.  "active".
  304.  
  305.  Maximum Priority is very useful to restore a directory regardless of the
  306.  file dates, and to make sure that all items in the second directory are
  307.  identical to those in the first one.
  308.  
  309.  
  310.  2.4.9      Delete in Directory 2
  311.  
  312.  This is another potentially "dangerous" option. It extends the update
  313.  process by deleting those files or directories in the second directory
  314.  which do not exist in the first directory.
  315.  
  316.  This option is normally used together with Maximum Priority. It could be
  317.  employed, for example, to maintain a backup copy of a hard disk
  318.  up-to-date, removing those files which have been removed (or moved, or
  319.  renamed) in the source since the previous backup. The result is that the
  320.  two directories are forced to be identical.
  321.  
  322.  
  323.  2.4.10     Fill Directory
  324.  
  325.  This function can be activated in single-directory mode. It causes empty
  326.  blocks on the storage device to be cleared.
  327.  
  328.  Normally, when files are deleted it is still possible to recover some
  329.  information with low-level disk tools. When delivering material to third
  330.  parties, this potential security risk can be prevented either by
  331.  formatting a new disk and copying the files to it, or by using a function
  332.  like DirDiff's "Fill Directory", which fills the directory with a file as
  333.  large as allowed by the existing space, and then deletes that file.
  334.  
  335.  
  336.  2.5        The Output Page
  337.  
  338.  This page displays the scrollable output list of DirDiff, which contains
  339.  entries for the directories and files processed, plus errors and other
  340.  messages in chronological order, followed by the final results as
  341.  displayed in the Status Page. The list can be saved to file, printed or
  342.  cleared (useful in case of memory shortage) by selecting the
  343.  corresponding gadgets.
  344.  
  345.  The output, just as processing, occurs in two phases (in two-directory
  346.  mode). The first phase does a preliminary check to see if the second
  347.  directory contains any items which are not present in the first directory
  348.  (in Delete mode, these are immediately deleted). The second phase scans
  349.  all items in the first directory, comparing them against the second
  350.  directory.
  351.  
  352.  In single-directory mode, DirDiff lists the size and checksum of each
  353.  file. The checksum is a simple sum of all bytes in the file. At the end
  354.  of the process an electronic signature is also printed. This has the
  355.  format "XXX-YYYYYYYY", where XXX stands for the program version, and the
  356.  Y digits are the actual signature. This is not a simple checksum. A
  357.  change in a single attribute bit of one of hundreds of files can
  358.  completely change the signature.
  359.  
  360.  Note: The signature method employed by DirDiff does not employ encryption
  361.  technology, thus it does not pretend to offer any protection against the
  362.  possibility that a set of source files can be artificially prepared to
  363.  produce a given signature. By being only 8 characters long (32 bit) the
  364.  signature leaves open the theoretical possibility that two different set
  365.  of files produce the same signature.
  366.  
  367.  The comparison of two directories produces an output showing the
  368.  differences found and the action being taken, if any. The possible
  369.  differences include: non-existence of an item or differences in contents,
  370.  name, attribute bits, comments and date. When DirDiff finds matching
  371.  items with different names (upper/lower case differences) it shows both
  372.  names. When it finds files with a different content but the same length,
  373.  it shows the offset in which the first difference was found.
  374.  
  375.  To resolve the differences (in Update mode), DirDiff can take one of the
  376.  following actions, on a case by case basis: copy the entire file, update
  377.  (copy newer over older) or force (copy older over newer) the parts which
  378.  are different, delete the item (directory or file), create a directory.
  379.  
  380.  At the end of a directory comparison process (two directories), DirDiff
  381.  prints final result, indicating whether it found any errors or
  382.  differences that could not be resolved. If the settings allowed for all
  383.  attributes of all files to be checked, and no differences were found,
  384.  then DirDiff will state that it has found the directories to be
  385.  identical.
  386.  
  387.  
  388.  2.6        The Status Page
  389.  
  390.  This page contains information on the number of files and directories
  391.  which have been processed, updated, created or deleted, and on the total
  392.  number of errors or unresolved differences. This information is updated
  393.  in real time as processing occurs.
  394.  
  395.  It should be noted that the counters indicating the total items being
  396.  processed are increased once for each item and for each separate access.
  397.  They are not indicators of the numbers of files and directories present
  398.  on the disk. If an item exists in both directories, it is accessed at
  399.  least once in each directory, thus counting as two. Plus, the counters
  400.  are also increased in the first phase.
  401.  
  402.  
  403.  2.7        Menus
  404.  
  405.  The items in the Project menu are standard Amiga application items,
  406.  equivalent to the corresponding gadgets in the window of DirDiff.
  407.  
  408.  The settings menu allows the user to save and reuse particular
  409.  configurations of settings, in a way similar to the standard menus found
  410.  in the Amiga system Preferences.
  411.  
  412.  The Save as Defaults command makes the current settings the default
  413.  startup settings.
  414.  
  415.  Last Saved reapplies the settings which were last saved, whereas Restore
  416.  resets all values to the initial program settings.
  417.  
  418.  If the Create Icons option is enabled, DirDiff will associate a Workbench
  419.  icon to all settings files written. A double-click on the icon loads
  420.  DirDiff with the settings stored in the selected file.
  421.  
  422.  
  423.  2.8        Examples
  424.  
  425.  The following examples show typical applications of DirDiff, indicating
  426.  which options have to be set in a position different than the default.
  427.  
  428.  
  429.  To show missing or different files and directories:
  430.  
  431.  - Default configuration
  432.  
  433.  
  434.  To verify a disk after a copy or optimization:
  435.  
  436.  - Quick option disabled
  437.  
  438.  
  439.  To verify a CD-ROM ISO image before mastering:
  440.  
  441.  - Dates set to "± 2 sec", Quick and Attributes options disabled
  442.  
  443.  
  444.  To compare Workbench files on an application disk:
  445.  
  446.  - Couples Only option active
  447.  
  448.  
  449.  To synchronize hard disk and floppy files:
  450.  
  451.  - Update and Couples Only options active
  452.  
  453.  
  454.  To make or refresh a backup copy (keeping history of "orphan" files):
  455.  
  456.  - Update and Lock Directory 1 options active
  457.  
  458.  
  459.  To make or refresh a backup copy (deleting "orphan" files):
  460.  
  461.  - Update, Lock Directory 1 and Delete options active
  462.  
  463.  
  464.  To make or refresh an exact copy:
  465.  
  466.  - Update, Maximum Priority and Delete options active
  467.  
  468.  
  469.  To check file integrity, show checksums and produce final signature:
  470.  
  471.  - Single directory mode
  472.  
  473.  
  474.  To clear unused blocks on a disk:
  475.  
  476.  - Single directory mode, Fill Directory option active
  477.  
  478.  
  479.  2.9       Program Messages
  480.  
  481.  Most error messages displayed by DirDiff are self-explanatory. For
  482.  example, simple AmigaDOS errors may occur when accessing (locking,
  483.  opening, examining, deleting, creating, renaming, copying or writing) a
  484.  file or directory. This may occur if an update exceeds the storage
  485.  capacity of the disk, for example. For most messages, an AmigaDOS error
  486.  code is also indicated. "Not enough memory" messages indicate that there
  487.  is insufficient free RAM.
  488.  
  489.  The following is a list of other messages, in alphabetical order.
  490.  
  491.  
  492.  Data length different from file length ...
  493.  
  494.  This message indicates that the number of bytes which DirDiff was able to
  495.  read from a file was different than the data associated to the file in
  496.  its directory entry. This could be caused by a problem in the filing
  497.  system structure (or also - but not necessarily - by a virus program
  498.  inserting some hidden link code into executable files). At Cloanto we
  499.  noticed this discrepancy to be quite common when processing other
  500.  computers' filing systems on the Amiga.
  501.  
  502.  
  503.  Data OK after retry on medium (possible random match)
  504.  
  505.  After discovering a difference in the contents of two files having the
  506.  same size, DirDiff read the location showing the difference a second
  507.  time, and found no difference between the files. The fact that two reads
  508.  of the same data produced two different results is likely to point to a
  509.  medium or I/O error, while the fact that the second read matched the
  510.  contents of the other file could be caused either by the error being
  511.  (temporarily) recovered, or by another error which caused the results to
  512.  match by pure chance.
  513.  
  514.  
  515.  Dates within ± 2 sec range - No update possible
  516.  
  517.  DirDiff is operating in Update mode, but encountered corresponding
  518.  entries in each directory which required an update, but had dates too
  519.  close to indicate with precision which item is newer. This only happens
  520.  if Dates is set to "± 2 sec".
  521.  
  522.  
  523.  Directory entries are of different types
  524.  
  525.  DirDiff encountered two entries (one in each directory) having the same
  526.  name, but different types, presumably one being a directory and one a
  527.  file. The two entries are skipped, as they can neither be compared, nor
  528.  updated.
  529.  
  530.  
  531.  Identical dates - No update possible
  532.  
  533.  DirDiff is operating in Update mode, but encountered corresponding
  534.  entries in each directory which required an update, but had identical
  535.  dates, making it impossible to determine which file is newer.
  536.  
  537.  
  538.  Indirect date change...
  539.  
  540.  As a side effect of DirDiff updating the files in a directory, the filing
  541.  system "touched" the date of the directory. DirDiff detects this and
  542.  restores the original date.
  543.  
  544.  
  545.  Internal error (...)
  546.  
  547.  These are internal errors which "should not occur". Reporting the error
  548.  condition to Cloanto would be helpful to correct the problem.
  549.  
  550.  
  551.  Medium Error (unconfirmed read on ...)
  552.  
  553.  Data consistency checks are performed routinely by DirDiff after certain
  554.  errors occur, or when unlikely file differences are detected (as in files
  555.  having the same name and length, but different contents). This message
  556.  indicates that DirDiff obtained results which were different from the
  557.  previous read. This could be caused by defects in the medium or in the
  558.  I/O system.
  559.  
  560.  
  561.  RAM error
  562.  RAM inconsistency
  563.  
  564.  DirDiff checks the RAM locations it uses to store its file comparison
  565.  buffers. These messages indicate that an error occurred during one these
  566.  tests. An "inconsistency" is an error which could not be confirmed by a
  567.  second test.
  568.  
  569.  
  570.  Read beyond end of file
  571.  
  572.  This message indicates that DirDiff was able to read more data (before
  573.  reaching the end of file) than the file length information in the
  574.  directory entry indicated. This message is similar to "Data length !=
  575.  File length", only that it occurs in a different context.
  576.  
  577.  
  578.  For additional information on this distribution of DirDiff please refer
  579.  to the "DirDiff.readme" text, also in the archive containing this file. 
  580.  
  581.