[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [Issue 2746] New - update overwrites w/o warning local modification if local timestamp did not change

From: Alan Barrett <apb_at_cequrux.com>
Date: 2007-03-21 20:29:57 CET

On Wed, 21 Mar 2007, Vincent Lefevre wrote:
> I'm not asking to choose between performance and support for some
> (non always broken) tools. Using ctime (possibly in addition to
> mtime[*]) should be fine.
>
> [*] that would take a few additonal processor cycles per file, so that
> the user won't see the speed difference.

If the underlying file system has file IDs (such as inode numbers on
unix-like systems), then you can also check whether the file ID has
changed. On unix-like systems, a single stat() call will give you
ctime, mtime, size, inode number, and several other fields. I'd check
them in this order: mtime, size, inode (if available), ctime (only if
inode is not available). I see no point in checking the ctime if inode
numbers are available, because the action of replacing a file with
another file (such as via the "mv" command on unix-like systems) will
always change the inode number, but will not necessarily change the
ctime.

--apb (Alan Barrett)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Mar 21 20:30:29 2007

This is an archived mail posted to the Subversion Dev mailing list.