Cannot seem to keep original file modification dates for all files when updating

Started by Infobleep, December 26, 2010, 07:00:48 AM

Previous topic - Next topic

Phil Harvey

Hi Tim,

I added a patch to the recent release which should help with this problem.  It sets the FileModifyDate again just before exiftool exits (even if CTRL-C is pressed).

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Infobleep

Thanks for doing that Phil. I've only just used ExifTool again last night and it was great. So much faster running it natively on my Mac, rather than via Windows, even with Fusion installed as opposed to VirtualBox.

geert

This problem persists on 10.5 leopard server despite having upgraded to the last version of exiftool (8.94). Strangely, this happens only when large numbers of files are being manipulated sequentially; when issuing commands file by file, all seems to work ok.

this is what i am doing:

# grab keywords from file
k=`exiftool -iptc:keywords <file name>`
# write keywords to same file without changing date modified
exiftool -P -overwrite_original_in_place -xmp:keywords="$k" <file name>

this works

I use this in python with a subprocess call, also works when processing images one at a time.

But when I run this in a script, processing about 10000 images, i get the error "error setting file time" back, and the date modified is not retained.
You said you had issued a patch addressing this problem, I was wondering if you have had any feedback on that.

Phil Harvey

This must be some sort of funny caching problem.  I consider it to be a bug in OS X.  The current version of ExifTool has a patch to remember all of the file times at try to set them a second time just before the program exits.  I never considered this patch to be 100%, but it seemed to solve the problem in the majority of cases.  Maybe I need to revisit this, but I can't think of where to start.   

I have seen similar problems with NFS mounts due to stale directory information being cached.  The solution there was to do a directory listing, which forced the cache to be updated.  Here, that would be an option except for its negative impact on performance.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).