have any of you found a way to use FC in a recursive way? I found
there is not a standard way to do it, and I think it's kind of useless
for big applications if you need to go directory per directory
creating diffs.
Any hints?
Thanks in advance,
-Fer Martin
Depends on quite what you mean.
But I've found FC to be a little unreliable. When performing a text
comparison with defaults and there is a line present in one file, missing in
another, it will sometimes report the missing line and two following lines
rather than the normal behaviour - the line each side. The lines involved
appeared to be of no particular significance - not first or last in file,
for instance, and I gain the impression that it might have something to do
with block-boundaries on the read operation.
I've also found that FC occasionally reports that it can't find a file when
there appears to be no reason since the same file can TYPEd and reacts
normally to other commands.Of course, that may have been that particular
system set-up, given that the system in question was maintained by a lying
incompetent lunatic bitch who got me the sack - but I seem to recall its
happening on other systems where networking was involved.
What exactly do you want to do?
Thanks for your help.
I'm aware of the bad things about FC, but still want to use this tool.
If you type:
>FC c:\dir1\*.* c:\dir2\*.*
you can get all the differences for the files between dir1 and dir2,
but you can't get to any inner directory (c:\dir1\myDirectory\...). So
what I'm looking for is a way to compare, not only files in a
directory, but all the files inside every subdirectory.
Any hints?
Thanks in advance,
Fernando
So - are you looking for identical subtrees, or to compare a set of files
against a subtree?
ie
FC c:\(complete subtree dir1)\*.* c:\(complete subtree dir2)\*.*
or
FC c:\dir1\*.* c:\(complete subtree dir2)\*.*
Either way, I'd suggest FOR /R would be a good start (see FOR /? from the
prompt)
or
FOR /F "tokens=*" %%x in ( ' dir /s /b /a:d c:\...... ' ) do ....
which should apply each subdirectory name in c:\...... to %%x
Also need to know what do do about the "file missing" situation where the
file matching the first AFN is missing in the target directory - and
possibly vice-versa.
>If you type:
>
>>FC c:\dir1\*.* c:\dir2\*.*
>
>you can get all the differences for the files between dir1 and dir2,
>but you can't get to any inner directory (c:\dir1\myDirectory\...). So
>what I'm looking for is a way to compare, not only files in a
>directory, but all the files inside every subdirectory.
If you want to compare two directory trees then there are better tools.
Here's one I've used in the past:
http://allan.hoiberg.dk/eng/prog_ct.htm