On Wed, Feb 05, 2003 at 09:17:03AM -0800, Mike Rubel wrote: > > CB> Of course, a major issue with --inplace is that the file will be > > CB> in an intermediate state if rsync is killed mid-transfer. Rsync > > CB> currently ensures that every file is either the original or new. > > > > I'm curious, how does it ensure this? > > During the copy, rsync writes to a temporary file in the same directory > (the temp file is hidden; it starts with a "."). Then, once the transfer > is done, it mv's that temp file over the original. My understanding is > that mv is atomic under unix, so this action either happens in its > entirety or not at all.
Even if mv is atomic, how does rsync make sure that the move doesn't happen before the last of the data is written to the tempfile? Does it explicity fsync the tempfile, or is there some other way it knows? -- Ben Escoto
msg06459/pgp00000.pgp
Description: PGP signature
-- To unsubscribe or change options: http://lists.samba.org/mailman/listinfo/rsync Before posting, read: http://www.tuxedo.org/~esr/faqs/smart-questions.html