Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copy only updated/added files/directories

Status
Not open for further replies.

jflo

Programmer
Mar 13, 2001
44
CA
I want to synchronize a folder from a network drive to a laptop. When ever the user needs to go on the road, he execute the app and voilà!, everything is synchronized.

So I need to copy files and folders from the netword drive to a folder on the laptop. Overall, the folder on the network drive has several folders and files totaling about 100Mb. I don't want to clear the laptop directory and copy everything from the network drive. I need only to copy what has changed since the last synch.

Any ideas? Any tools or add-ins? What API to use? How would you do it? How should I do It?

Thanks a bunch
 
You can get simply copy routines any where, they are quite simply in fact.

But the trick to what you want is to look at the archive bit of the file.

look in the vb6 help and search for setattr and getattr.

In your file copy program have it find all the files in the directory, then have it only copy the ones with the archive bit set. Remembering to turn the archive bit off after the file is copied (in both the source and destination directory).

The archive bit is set anytime the file is modified and saved. Heck you can even use xcopy at a dos prompt with the command switch /a


Regards,
Troy Williams B.Eng.
fenris@hotmail.com

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top