• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: My little file copy/backup program
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >My little file copy/backup program (From: "Bobby B" <email@hidden>)
 >Re: My little file copy/backup program (From: Ondra Cada <email@hidden>)
 >Re: My little file copy/backup program (From: Scott Ellsworth <email@hidden>)

  • Prev by Date: Re: Keychain problems with i386
  • Next by Date: Re: Miss #include <vector>
  • Previous by thread: Re: My little file copy/backup program
  • Next by thread: CoreData crash on dealloc
  • Index(es):
    • Date
    • Thread