[Originally posted by didier on 2006-01-23 11:18:07-08]
Hi,
I work on windows 2000, sp4 with ActivePerl and Exiftool 5.46
I have to update some metadatas.
All work fine except with some files within character "~" in the name.
If this character is at the begining of the name, like "~5717028.jpg", the update works fine.
If the character is somewhere inside the name like "PHOTOS~1.JPG", exiftool return this error :
Error renaming C:\PERRIC\original\PHOTOS~1.JPG
Platform image source is MacOS, upload onto our windows 2000 server through our web site.
Thanks for your help.
Didier
[Originally posted by exiftool on 2006-01-23 12:58:56-08]
This problem is OS-dependent. Unfortunately I don't have a Windows 2000 machine
to test this on. Perhaps you could try one thing for me. Try renaming "PHOTOS~1.JPG"
to "PHOTOS~1.JPG_original". This is what ExifTool was trying to do. Perhaps this
is an illegal name on your file system.
Until we figure out what is going wrong, you can always bypass the renaming code by
using the "-o DIRNAME" option to specify a different output directory.
[Originally posted by minimal on 2006-01-23 13:20:32-08]
From what I can recall of Windows filename API's, in the shift from the DOS 8.3 (8 character filename, 3 character extension) naming to long names (in Win95) the older 8.3 filename calls truncated the file using ~'s and numbers. If you are then using the same DOS API calls to try and create "PHOTOS~1.JPG_original" then it breaks the 8.3 naming convention and the call will fail.
It's been so long (10 years) since I did this I can't recall the name of the long filename aware API, but it might give you a place to start looking, if that helps: it's also easy to test - stop ExifTool from backing up the changes by using the "-overwrite_original" flag and see if it works (but please take care to do this on a copy of your images !).
--
Ian Spray
[Originally posted by didier on 2006-01-23 14:27:51-08]
The very strange thing is that the file "PHOTOS~1.JPG_original" is created but the file "PHOTOS~1.JPG" disappear from the folder.
That works very well with "Ballantine's-studiophoto.jpg".
Didier
[Originally posted by exiftool on 2006-01-23 14:58:37-08]
I think Ian is correct with his 8.3 theory. I also remember something about the long filenames
getting converted to the "~###" for 8.3 compability.
The fact that the "_original" file was created and the existing file disappeared indicates that the
rename actually succeeded, and what failed was actually the subsequent tests to verify that the
"_original" file existed.
But I think that regardless of where the failure is occuring, it is best to either avoid using "~" in
file names, or use the -o option to avoid creating files with extensions longer than 3 characters.
You can try Ian's suggestion of using the "-overwrite_original" option, but there is a chance that
this will fail too because in this case ExifTool first writes to a temporary file ending in "_exiftool_tmp",
which it then must rename.