Rename file using FileName tag

Started by UKenGB, February 09, 2020, 01:27:34 PM

Previous topic - Next topic

UKenGB

I'm using 'Overwriteinplace' (or whatever correct term is as I cannot access it right now) in order to update files while preserving Finder Comments and file tags. This works except...

In same cases I need to rename the file also and when I use the FileName tag to do this, it seems to create a copy and delete the original, so losing the aforementioned extended attributes. If I manually use 'mv ...' the file is simply renamed, keeping all its associated data.

Is there a way to use Exiftool's FileName tag to simply rename the file like 'mv' does?

Phil Harvey

Interesting, thanks.  This isn't the behaviour that one would hope for.  I'll look into this.

Until I fix this, you can break this into two separate commands.  The first to write "real" tags using -overwrite_original_in_place, and the second command to just set the FileName.

- 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 ($).

Phil Harvey

This is actually quite complicated.  I think I'll just have to document this for now:  The -overwrite_original_in_place option reverts to the behaviour of -overwrite_original when also writing the FileName and/or Directory tags.

This should make sense if you realize that the FileName and Directory tags may to point to a different filesystem, and in this case there is no way to update the original file in place.  True, ExifTool could be patched to add specialized code to test to see if the file will be staying on the same filesystem and then overwrite the original only in this case, but I'm not happy with this solution because it complicates the code quite a bit without fully solving the issue.

- 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 ($).