Synchronizing files

Discussion in 'Rebol' started by MaxV, Oct 7, 2010.

  1. MaxV

    MaxV Member

    Hello,
    is modified? a good and secure way to evaluate when synchronizing files?
    Did you ever encounter any problems with modified? ?
    Thanks
    Max
  2. Sunanda

    Sunanda New Member

    Four problems with modified?:
    1. You may get false hits:: a file's contents may not have changed, but its date may have (perhaps if it has been copied from somewhere else, or restored from a backup);
    2. Time sequence is not reliable: clocks can be set differently on different machines, or reset on one machine (think when daylight saving kicks in) so you cannot assume that the file with a later timestamp is the later version. All you can assume is that the file may have changed;
    3. Same timestamp may hide a file change: you'd be very unlucky for this to happen, but it is a theoretical possibility. Imagine you change a file around the same time the time is reset on the computer. The newer file may just (one in a million chance) get saved back with the same timestamp;
    4. Timestamps can be falsified: using utilities, the timestamp could be set to any value.

    I have one application where I need to sync files. That's when we upload new CGI scripts to REBOL.org. We don't use modified? for that. Instead, we check if a checksum/secure has changed.

    That works in our case because the files are small, so generating 500 or so checksums takes just a few moments.
  3. MaxV

    MaxV Member

    False hits is the main problem for me, even looking a file can produce a change in modifying timestamp.

Share This Page