File.Copy missing 5KB at destination

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a simple concole application. It queries a database, generates a
formatted file locally, then copies the file to a location on the network.
The file sizes are between 20MB and 60MB. The file generates fine and is
correctly formatted locally, but when it is copied (using a simple
File.Copy(src, dest, ow)) the destination file is always 5KB smaller. This
would be a nice feature except that there is data missing from the file. The
problem occurs regardless of file size or destination location. The only
difference is that it only occurs inside the original console application
(e.g. I tested copying with a new solution that took an existing file and
copied it and it worked). Debugging reveals nothing.
 
Although it seems to be dumb question, I wish to clarify the size difference
you saw is the "actuall size" or "on disk size"?

Also, after you generates the file, did you try to "flush" the content
first? Try add Flush()(or actually a proper Close() will do)and see if it
helps.
 
Back
Top