473,499 Members | 1,909 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

File comparison question

I'm teaching myself VB6. As a first project, I've decided to work on
a Window's version of the Unix command, "diff" -- with a few twists.
But being unfamiliar with VB, I am unsure as to how to best compare
two files and/or directories.

A byte-by-byte comparison would probably be best but slow, correct?
What about computing a CRC for each file and then compare those. any
faster?
OR
Compare file-sizes, and create/access times. Would that be a reliable
enough comparison?

Any thoughts, comments, suggestions, pointers to sample code, etc.
welcome.

Bill W
Jul 17 '05 #1
1 3486
On 29 Sep 2003 08:09:00 -0700, bw******@lucent.com (Bill W.) wrote:
I'm teaching myself VB6. As a first project, I've decided to work on
a Window's version of the Unix command, "diff" -- with a few twists.
But being unfamiliar with VB, I am unsure as to how to best compare
two files and/or directories.

A byte-by-byte comparison would probably be best but slow, correct?
What about computing a CRC for each file and then compare those. any
faster? Calculating a CRC involves reading every byte
- there is also (a very small) possibility of errorOR
Compare file-sizes, and create/access times. Would that be a reliable
enough comparison? File sizes are Ok - create/access datetimes are irrelevant
Any thoughts, comments, suggestions, pointers to sample code, etc.
welcome.

Bill W


Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
2549
by: Smith | last post by:
I know this question is not much related to this news group. Is there any free utility on the web which campares files in two folders for changes. I wanted to compare two set of .ASPX files?...
5
3764
by: Learner | last post by:
Hello, Here is the code snippet I got strucked at. I am unable to convert the below line of code to its equavalent vb.net code. could some one please help me with this? static public...
2
6752
by: eastern_strider | last post by:
I'm running into problems about defining a comparison function for a map which has a user defined key. For example: class Key { public: string name; int number; Key (na, nu) : name (na),...
7
2475
by: Alan | last post by:
Hi. I have programmed in C++ before, but I`m a couple of years out of practice. I am seeking some advice on getting started on a quickie project. . . . I have to read a 54MB text file and do a...
10
3638
by: mickey22 | last post by:
Hi all, I have to perform binary comparison of the generated files each time I build my program. For example in my first build I generate a header file and data file and store them in...
1
1826
by: Roy | last post by:
Hello, As a part of my application,I need to compare files generated everyday.I need not need to compare the file contents.I just need to compare the file size,the line count.The files are named...
3
4376
by: =?Utf-8?B?R0I=?= | last post by:
I have created a small program that illustrates the problem. I would know how to address the fields that I want to sort on in the greaterThan comparison. Anybody who knows?? using System; ...
3
2091
by: hutch75 | last post by:
Question could also be asked, how to compare data between two arrays and perform an action (print cmd) everytime there is a match? The problem I'm having with the code below is that the comparison...
5
695
by: evanevankan2 | last post by:
I have a question about the warning 'comparison between signed and unsigned' I get from my code. It comes from the conditional in the outer for loop. I understand the warning, but I'm not sure...
0
7131
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7007
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7174
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7220
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6894
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5470
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4919
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4600
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3099
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.