in reply to Best practices for file synchronization? (Mod time vs. contents compare)

On my own computer, I use a combination of file size, modification time, and ctime (creation on Windows, inode change time on Unix). Unless people are particularly trying to hide changes, that should suffice. And you can get all three using just one stat call.

In fact, on Unix, I have the impression that just checking ctime is enough, as any change to the file changes that timestamp, and it cannot be changed manually. Unfortunately, that's not the case on Windows.

  • Comment on Re: Best practices for file synchronization? (Mod time vs. contents compare)

Replies are listed 'Best First'.
Re^2: Best practices for file synchronization? (Mod time vs. contents compare)
by brd (Acolyte) on Jun 15, 2006 at 01:56 UTC
    > In fact, on Unix, I have the impression that just checking ctime is enough, as any change to the file changes that timestamp, and it cannot be changed manually.

    I believe this is incorrect, but I'm not sure how it is done.

      I've looked at some freely available C source code to change ctime of files, and wht it does is change the clock time, change a file's ctime to the "current time", and change the clock back. (I'll link to it if I can find it back.)

      If this hack is the only way to achieve it, I think you can state it can't be done.