home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 July / CMCD0704.ISO / Software / Complet / FreeDOS / fdbootcd.iso / FREEDOS / PACKAGES / BASE / DISK01 / FCX.ZIP / HELP / FC.EN
Text File  |  2003-08-06  |  4KB  |  88 lines

  1. FC v. 2.22 (c) 2003 Maurizio Spagni
  2.  
  3. FC compares two files or sets of files, in text or binary mode, and
  4. displays the differences between them.
  5.  
  6. FC implements Paul Heckel's algorithm from the Communications of the
  7. Association for Computing Machinery, April 1978, p264 - p268,
  8. "A Technique for Isolating Differences Between Files".
  9.  
  10. This algorithm has the advantage over more commonly used compare algorithms
  11. that it is fast and can detect differences of an arbitrary number of lines.
  12. For most applications the algorithm isolates differences similar to those
  13. isolated by the longest common subsequence.
  14.  
  15. The syntax is as follows:
  16.  
  17. FC [switches] [drive1:][path1]filename1 [drive2][path2]filename2 [switches]
  18.  
  19.  /A    Display only first and last lines for each set of differences
  20.  /B    Perform a binary comparison
  21.  /C    Disregard the case of letters
  22.  /L    Compare files as ASCII text
  23.  /LBn  Set the maximum number of consecutive different ASCII lines to n
  24.  /Mn   Set the maximum differences in binary comparison to n bytes
  25.  /N    Display the line numbers on a text comparison
  26.  /S    Extend the scan to the files in subdirectories
  27.  /T    Do not expand tabs to spaces
  28.  /W    Pack white space (tabs and spaces) for text comparison
  29.  /X    Do not show context lines in text comparison
  30.  /nnn  Set to nnn lines the minimum number of consecutive matching
  31.        lines for comparison resynchronization
  32.  
  33. FC defaults to binary mode for files .EXE, .COM, .SYS, .OBJ, .BIN and .LIB.
  34.  
  35. In binary mode FC shows the offset in the file of the differing bytes, their
  36. value in hexadecimal and, if they are ASCII printable chars, their ASCII char.
  37.  
  38. By default the binary compare stops after 20 differences but that value can
  39. be modified through the /M switch. /M0 means "unlimited differences".
  40. /M is interpreted as /M0.
  41.  
  42. A design limitation of this program is that, in the text mode file
  43. comparison, only the first 32765 lines are compared; the remaining lines are
  44. ignored. The line length is virtually unlimited.
  45.  
  46. FC supports wildcards in the file specifications. Some words on this:
  47. - specifying a directory is the same as specifying all the files in that
  48.   directory (i.e. "*.*").
  49.   Example: "FC C:\ A:" is the same as "FC C:\*.* A:*.*"
  50. - if no filename2 is entered then "." (the current directory) is assumed.
  51.   Example: "FC C:\FOO.TXT" is the same as "FC C:\FOO.TXT .\*.*"
  52. - if filename1 has wildcards but filename2 hasn't, then all the files
  53.   matching filename1 are compared with the same file filename2.
  54.   Example: "FC FOO.BK? FOO.TXT"
  55.        All the files FOO.BK? are compared with FOO.TXT
  56. - if filename1 has wildcards and filename2 is a path followed by "*.*" then
  57.   all the files matching filename1 are compared with the files with the same
  58.   name but in the path specified by filename2 (if that file exists, of course).
  59.   Example: "FC *.* A:*.*" or, in short, "FC . A:"
  60.        All the files in the current directory are compared with
  61.        their copy on A:
  62. - if filename1 has wildcards and filename2 too then all the files in the path
  63.   of filename1 and matching filename1 are compared with the relevant file
  64.   matching filename2 in the path specified by filename2 (if that file exists,
  65.   of course).
  66.   Example: "FC *.TXT OLDS\*.BAK"
  67.        All the files in the current directory are compared with their
  68.        backup copy renamed .BAK in the subdirectory OLDS.
  69. It's more easily done than said.
  70. If what you really want is to compare each file in a directory with all the
  71. files in another you can always use the form:
  72. FC *.* MYDIR\????????.???
  73.  
  74. The /S option iterates the same pattern of search in the subdirectories with
  75. the same name in both path.
  76.   Example: "FC /S C:*.TXT D:*.BAK"
  77.        Assuming for example the existence of the subdirectories C:BOOK
  78.        and D:BOOK, this command compares all the *.TXT files with their
  79.        backup copies *.BAK in the current directories and also all the
  80.        BOOK\*.TXT files with their backup copies BOOK\*.BAK.
  81.  
  82. The exit codes for ERRORLEVEL are as follows:
  83.     0    All the files match
  84.     1    At least a pair of files differs
  85.     2    Invalid parameter on the command line
  86.     3    File not found
  87.     4    Error opening file(s)
  88.