|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
File.Copy missing 5KB at destinationI 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. Show quote "Matt Hamilton" <MattHamil***@discussions.microsoft.com> ¼¶¼g©ó¶l¥ó·s»D:CA31AD78-8E95-4AB4-B1D9-44086E145***@microsoft.com... >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. |
|||||||||||||||||||||||