home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The CDPD Public Domain Collection for CDTV 3
/
CDPDIII.bin
/
pd
/
utilities
/
cli
/
fdiff
/
fdiff.doc
< prev
next >
Wrap
Text File
|
1992-10-27
|
3KB
|
127 lines
FDiff version 1.00, copyright 1992 by Nicolas Dade.
All Rights Reserved. Permission is hereby granted for non-commercial
duplication and distribution, and for dist ribution by BBSs which do
not charge for downloads, and for distribution in dis k collections
which charge a nominal fee per disk. This is not shareware.
** what **
A fast diff.
It compares two text files on a line-by-line basis, outputing to
STDOUT the lines which differ, with a "+ <line number> " precceding
lines from the NEWFILE, and a "- <line number> " preceeding lines from
the OLDFILE.
FDiff requires 2.04 and can only be used from a shell.
** why **
I couldn't find a diff which didn't take _forever_ on my machine when
comparing even short, simple files. So I wrote my own, in assembler of
course, and now I don't understand how other diffs who's output is
_identical_ to FDiff's can be so slow. But I doesn't effect me any
more. :)
** how **
Say you have changed a program's source, and now it doesn't work
any more, and you did this over several days, so you can't remember
every little thing you changed, you can ask FDiff to find those for
you. In a shell, type
FDiff newsource.asm oldsource.asm
and you will get a dump of all the lines you changed (you might want
to redirect this to a file instead of to the screen).
** fine details **
FDiff has only one optional parameter: RESYNC (it has only one
internal parameter too: RESYNC, so don't think you're not being given
control of everything). RESYNC is the number of consecutive matching
lines which will be required before FDiff will consider the two files
to be resynchronized. The default value is 5.
For example, if the file where:
newfile:
this 1
is 2
the 3
new 4
file's 5
best 6
line. 7
It 8
is 9
already 10
new. 11
oldfile:
this 1
is 2
the old 3
file's 4
best 5
line. 6
Is 7
it 8
already 9
old? 10
and you said "FDiff oldfile newfile 1" you'd get the output
+ 3 the
+ 4 new
- 3 the old
+ 8 It
+ 9 is
- 7 Is
- 8 it
+ 11 new.
- 10 old?
but if you said "FDiff oldfile newfile 2" you'd get the output
+ 3 the
+ 4 new
- 3 the old
+ 8 It
+ 9 is
+ 10 already
+ 11 new.
- 7 Is
- 8 it
- 9 already
- 10 old?
since the single matching line "already" is not enough to resync the
files.
When one file ends, the rest of the other file is outputed as changed
lines.
There is no limit to the number of lines FDiff will look at when in
search of a resync, except that they must all file in memory.
How fast is FDiff? Two 18K source files w/ 650 lines each, and 270
differing lines takes 6 sec to diff on a 8 MHz 68000 machine (i.e.
a plain jane A500 or A2000) with both files in ram:, and output
redirected to a file in ram:.