Comparing text files

  • Thread starter Thread starter Peteroid
  • Start date Start date
P

Peteroid

I realize this might not be the correct newsgroup, but since I have a
general question I need answering in the context of doing a managed VC++.NET
Managed application, this is as good a place as any to get the ball rolling.
Where is the appropriate place to ask the following question:

Is there any way to compare two text files to see if they are identical?
There use to be an easy DOS command many years back, but not sure how to do
this in Windows XP!

[==Peteroid==]
 
Peteroid said:
I realize this might not be the correct newsgroup, but since I have a
general question I need answering in the context of doing a managed
VC++.NET Managed application, this is as good a place as any to get
the ball rolling. Where is the appropriate place to ask the following
question:
Is there any way to compare two text files to see if they are
identical? There use to be an easy DOS command many years back, but
not sure how to do this in Windows XP!

fc.exe still exists - you could always shell out to fc to compare the files
for you (use ShellExecute or a member of the *exec*() family of fine
functions in the C runtime library, or CreateProcess from the Win32 API if
you're a glutton for punishment.

You can also read the contents of the files into blocks of memory and
compare them yourself. If the files might be large, you'd want to write
code that's a bit more general and compares the files in chunks rather than
all at once so you don't have to allocate large blocks of memory.

-cd
 
Peteroid said:
I realize this might not be the correct newsgroup, but since I have a
general question I need answering in the context of doing a managed VC++.NET
Managed application, this is as good a place as any to get the ball rolling.
Where is the appropriate place to ask the following question:

Is there any way to compare two text files to see if they are identical?
There use to be an easy DOS command many years back, but not sure how to do
this in Windows XP!

[==Peteroid==]

<sam>
you can use Windiff tool, which is available if you install microsoft
visual studio .
 
Back
Top