473,396 Members | 1,992 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

File Compare

Hi.

In a VB.Net program I use File.Copy to copy some zipped (and text) files
from one server to another. I'm required by management to do a file compare
after the copy has completed.
Is the File.Copy sufficient and it will error out if there's a problem or do
I need to do a file compare to make sure nothing went wrong in the copy?

If I do need to do a file comapre I was thinking about shelling out and
running a bat file to use the Dos "FC" and pipe the results to a file which I
can then search for "no differences found".

This seems to be a clumsy way and I'm thinking there must be something more
efficient out there.

Thanks,
Rita
Nov 22 '05 #1
2 4091
I've never used the FC command before, but after a very quick look, I can
tell you it won't do a compare on binary/zipped files.
If it's just text files, then yes, it's suitable. However, IMO I think it's
a clumsy way as well.
One step up from using FC is to use WinDiff or similar.. but again clumsy.
Personally, if you just want to check that the file was copied OK, and IF
there are any differences (i.e. not what they are) then you can use many
properties of the file as check items. For instance, the file size,
revision (if it's an exe), date last modifed, date created, etc.

To answer your question about File.Copy being sufficient... I believe there
are enough fail-safe routines in Windows itself to copy the file correctly -
if it's not a good copy, you'll get some sort of exception or other error.

HTH
__________________________________________
The Grim Reaper

"RitaG" <Ri***@discussions.microsoft.com> wrote in message
news:FA**********************************@microsof t.com...
Hi.

In a VB.Net program I use File.Copy to copy some zipped (and text) files
from one server to another. I'm required by management to do a file
compare
after the copy has completed.
Is the File.Copy sufficient and it will error out if there's a problem or
do
I need to do a file compare to make sure nothing went wrong in the copy?

If I do need to do a file comapre I was thinking about shelling out and
running a bat file to use the Dos "FC" and pipe the results to a file
which I
can then search for "no differences found".

This seems to be a clumsy way and I'm thinking there must be something
more
efficient out there.

Thanks,
Rita

Nov 22 '05 #2
Thanks for the response which helped a lot :-)

I landed up using the Stamina.DXFileCompare method.
Since this didn't work in VB.Net I created a wrapper VB6 function for it.

It's good to know though that the File.Copy is robust enough to return an
error if the file didn't copy over correctly.

BTW, I couldn't use the file attribute filesize since that's what got us
into trouble in the first place. After a file copy (I don't know what method
was used for the copying - it was done by another department) the copied file
showed the same size as the original one when in fact it was missing rows
from the end of the file.

Rita

"The Grim Reaper" wrote:
I've never used the FC command before, but after a very quick look, I can
tell you it won't do a compare on binary/zipped files.
If it's just text files, then yes, it's suitable. However, IMO I think it's
a clumsy way as well.
One step up from using FC is to use WinDiff or similar.. but again clumsy.
Personally, if you just want to check that the file was copied OK, and IF
there are any differences (i.e. not what they are) then you can use many
properties of the file as check items. For instance, the file size,
revision (if it's an exe), date last modifed, date created, etc.

To answer your question about File.Copy being sufficient... I believe there
are enough fail-safe routines in Windows itself to copy the file correctly -
if it's not a good copy, you'll get some sort of exception or other error.

HTH
__________________________________________
The Grim Reaper

"RitaG" <Ri***@discussions.microsoft.com> wrote in message
news:FA**********************************@microsof t.com...
Hi.

In a VB.Net program I use File.Copy to copy some zipped (and text) files
from one server to another. I'm required by management to do a file
compare
after the copy has completed.
Is the File.Copy sufficient and it will error out if there's a problem or
do
I need to do a file compare to make sure nothing went wrong in the copy?

If I do need to do a file comapre I was thinking about shelling out and
running a bat file to use the Dos "FC" and pipe the results to a file
which I
can then search for "no differences found".

This seems to be a clumsy way and I'm thinking there must be something
more
efficient out there.

Thanks,
Rita


Nov 22 '05 #3

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

Similar topics

3
by: Raseliarison nirinA | last post by:
hi all, i found an unanswered question at http://www.faqts.com/knowledge_base/index.phtml/fid/538 with possible response below. i've tried to send it at faqt.python but can't figure out how to...
0
by: SeanR | last post by:
I have a function to copare two files. It will first copy the original file form a different server to a local temp path and then compare that version to a version that has been restored form tape....
2
by: zjut | last post by:
want to add a string to the file and the file is sort by letter! for examply: the follow file is a big file! ////////////////////// abort black cabbage dog egg fly ////////////////////
2
by: RitaG | last post by:
Hi. In a VB.Net program I use File.Copy to copy some zipped (and text) files from one server to another. I'm required by management to do a file compare after the copy has completed. Is the...
46
by: dawn | last post by:
Hi all, I am now working on a C program under Unix. The requirement for the program is that: A file name is passed to program as a parameter. The program will Find files under a specified...
0
by: Sunit Joshi | last post by:
Hello All I'm trying to figure out how to do this the best way. Basically, I need to compare DateTime of files across TimeZones. The situation is like this: 1. I have a database say in Korea...
18
by: Torben Laursen | last post by:
Hi Can anyone tell me what is the short-cut to switch between a .h and .cpp file, thanks Torben Laursen ---
1
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...
8
by: Perl Beginner | last post by:
I am new to Perl and new to this site. I have the same question that I keep seeing, but not finding an answer…why doesn’t the compare function work? I’ve been going at this for a while. My code is...
3
by: blunt | last post by:
right the program is nearly complete just a couple of little tweaks and i should have it. The purpose of this program is to write config files for colubrius wireless access points but it's falling...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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...
0
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...

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.