On Wed, 23 Jul 2008 13:32:16 -0700 (PDT), CSharper <cs******@gmx.com>
wrote:
>I have a data file which is 2.1GB (zipped), when the exe runs, it
copies the content of the zip file to a destination folder. What is
the best way to achive this? Current implementation is to zip the file
at the source and at the destination unzip the file and if the file
dates are different then copy the files over. Is there a better way to
do this other than zipping and unzipping?
Thanks.
When you create the big zipped file, also create a very small file at
the same time at the source. The small file contains a date/copy
number/serial number/whatever identifying the current iteration of the
large file.
Copy the small file to the destination first and check its date/etc.
against the date/etc. of the current version of the small file. If
they are different then update the small file and copy over the large
file. This avoids copying over the large file unless you have to -
the small file tells you enough to know whether there is an updated
version of the large file without having to copy the whole thing over
the network.
Zipping is a good way to reduce network load when you do have to get a
new copy of the large file.
A more radical solution would be for the update file to merely contain
the changes from the last time, though this might be too much effort
to set up from scratch. Probably easier to use a database at both
ends and to use the built-in synchronisation routines.
rossum