Attachmental
Jan. 25th, 2005 12:27 pmIf I save a .csv file from an email attachment to a samba-mounted drive, overwriting a pre-existing file of the same name, it doesn't change the last-updated time for the file.
Quite apart from the general problems of no longer knowing when you last updated something, this means that if your processing script is looking for new updates in order to overwrite the old data with the new, this means the script completely fails to find the 'new' file, since according to its timestamp it is frankly old hat. Which is something of a nuisance.
This behaviour on the part of attachments has started quite randomly -- or rather, as far as I can tell, not due to any action on my part. Does anybody know of any way of persuading it to stop?
Quite apart from the general problems of no longer knowing when you last updated something, this means that if your processing script is looking for new updates in order to overwrite the old data with the new, this means the script completely fails to find the 'new' file, since according to its timestamp it is frankly old hat. Which is something of a nuisance.
This behaviour on the part of attachments has started quite randomly -- or rather, as far as I can tell, not due to any action on my part. Does anybody know of any way of persuading it to stop?
no subject
Date: 2005-01-25 12:52 pm (UTC)Remember to check the time stamps on the local files as well, just in case.
That will, at least, explain whether it's the email client that's causing the problem, or the samba mount.
no subject
Date: 2005-01-25 01:05 pm (UTC)Actually this doesn't clarify at all, does it? I am very confused now.
no subject
Date: 2005-01-25 01:00 pm (UTC)no subject
Date: 2005-01-25 01:09 pm (UTC)Oh, hang on, wait.. Either I'm going mad, or it really is true that if I delete the old file first and then save the new attachment it still has a really old timestamp! I think something is screwy with these files. How can you edit a file and not change its timestamp??
Time passes slowly and fades away
Date: 2005-01-25 01:16 pm (UTC)What colour is the sky?
no subject
Date: 2005-01-25 01:21 pm (UTC)So basically, (sit down before you read this next bit and have the smelling salts handy), Windows doesn't do this properly.
no subject
Date: 2005-01-25 01:25 pm (UTC)no subject
Date: 2005-01-25 02:05 pm (UTC)no subject
Date: 2005-01-25 02:18 pm (UTC)So in summary: computers = rubbish.
no subject
Date: 2005-01-25 03:03 pm (UTC)The mtime is the last time the file's data was modified; the ctime is the last time its inode was modified. So in general, a change to the data automatically implies a change to the inode (if only to update the mtime!) and hence the ctime will generally be equal to or later than the mtime. Commands such as
chmodcan alter the ctime without affecting the mtime, but I can't immediately think of any that can possibly have the reverse effect.(That said, a read-only access to the file updates the atime, but this doesn't count as enough of a change to cause the ctime to update. Quite why the mtime update couldn't have had that property as well I have no idea, but apparently it doesn't.)
It is annoying, and I think it would be much more useful to have a creation timestamp (although it's fiddly to work out the correct semantics in some situations - should a file change its creation timestamp if you rename another file over the top of it, for example?) in place of at least one of the ctime and mtime.
no subject
Date: 2005-01-25 03:30 pm (UTC)no subject
Date: 2005-01-25 05:48 pm (UTC)Writing to a file often involves such things as writing back the new file length — and possibly a new list of disk blocks — to the inode, so it's usually more complicated than just "updating the mtime". The ctime does also change when the file length doesn't, but that's probably done for consistency as well as the fact that it's useful for backup reasons as mentioned above.
no subject
Date: 2005-01-25 01:47 pm (UTC)