Blog Archive

Monday, October 29, 2007

syncdir.exe

Usage: syncdir <A> <B> (download)

You give it two directories, and it copies everything from directory A to directory B (based on file dates).

One optimization involves only reading each directory listing once (makes a big difference for network drives).
Another is that the smallest files are copied first. This tends to move more useful per data per unit of time than dumb depth-first copiers. Why? Imagine a huge file sitting early in the directory tree, that's going to block your transfer. Now you have to figure out how to skip it -- pain in the ass. Sorting by size avoids this.

Examples of other options: /ext:.cpp;.h or /noext:.obj;.dll

2 comments:

  1. It looks like it's a good utility, I'll try to use it to copy files to our production server.

    But its got to be named copydir instead of syncdir (ok, smartcpy). To be a real "sync" utility it have to delete destination files missing in source, correctly replace read-only files.

    Hope you fix that in next version.

    ReplyDelete
  2. Another problem found. Syncdir copy files with read-only attributes. That may be good.

    But it cannot rewrite files with read-only attributes copied by itself. Below is an error message.

    Error: Access is denied.

    ReplyDelete