Reputation: 1629
I'm doing a file sync between a client, server and Dropbox (Mac client, Debian server). I'm looking at the mod times of files to determine which is newest. On the client I'm using os.path.getmtime(filePath)
to get the modified time.
When I check the last modification time of the file on the client and then, after uploading I check again on the server or Dropbox there is a varying difference in the time between them all for the same file. I thought file mod times were associated with the file rather than os they are on, so if the file was last modified on the client, that mod time stamp should be the same when checked on the server?
Could anyone clarify if uploading the file has an impact on the mod time, or suggest where this variation in time for one file could be coming from? Any advice would be greatly appreciated!
Upvotes: 0
Views: 83
Reputation: 16940
The modified time on the Dropbox server isn't necessarily going to be the modified time on the client, but rather the time the file was uploaded to the server. You can use the 'rev' property on files from the /metadata call to keep track of files instead.
Upvotes: 1