Re: My little file copy/backup program
Re: My little file copy/backup program
- Subject: Re: My little file copy/backup program
- From: Camillo Lugaresi <email@hidden>
- Date: Wed, 22 Mar 2006 19:12:51 +0100
On 22/mar/06, at 18:36, Scott Ellsworth wrote:
On Mar 22, 2006, at 8:59 AM, Ondra Cada wrote:
Bobby,
On 22.3.2006, at 17:16, Bobby B wrote:
I'm posting this cause maybe there is one person out there who knows
less Cocoa than I, so it may help them :) If anyone has comments on
why I'm doing something stupidily, please say!
Well if you insist... having just a moment now, why not :)
First, of course, it's pretty disputable whether it makes sense at
all to program something like this for a system where rsync is
available and NSTask has a nice API. Depends: for a real app
probably not, but great for learning :)
Beware, though, that the system supplied rsync has a bug that is a
deal killer for most file copying programs.
If you supply the --extended-attributes and the --archive flag, it
uses the present time for the modified time on the destination
file, rather than the source file modified time. Without --
extended-attributes, it works correctly as documented.
Thus, you are going to have to use your own rsync anyway, which may
mean digging into what it is doing enough to make your own, more
special purpose, algorithm a reasonable option.
(Some afternoon I must look into that code. It has all the feel of
a pair of calls out of order; it does the right thing with each
option separately. All the hard work has already been done.)
You can find a patch for that bug here: <http://www.lartmaker.nl/rsync/>
That patch, in turn, has some flaws in the way it fixes the
modification time; I sent a patched patch to the author, but he
hasn't replied yet. If anyone wants it, let me know.
Camillo
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden