ExifTool Forum

ExifTool => Bug Reports / Feature Requests => Topic started by: Bona Sierra on July 16, 2024, 03:22:45 PM

Title: -ext produces / on windows
Post by: Bona Sierra on July 16, 2024, 03:22:45 PM
Hi all,

when using "-filepath -ext extension" with the -p command, the path output is with "/" instead of "\" on windows systems, so I have to apply a string substitution as workaround.
e.g. exiftool -m -p "$filepath"  -ext JPG .
output: H:/IMG/Original/20180630_220548_944.JPG


Using file extension w/ or w/o wildcard always outputs "/" instead.
e.g. exiftool -m -p "$filepath" 20180630*.jpg
output: H:\IMG\Original\20180630_220548_944.JPG

Exiftool should always use the system delimiter character for directory names.

Exiftool version is 12.87
Terminal window on Windows 11 Pro Build 22621
Title: Re: -ext produces / on windows
Post by: Phil Harvey on July 16, 2024, 04:09:58 PM
Sorry, but ExifTool has used forward slashes for the last 20 years without a request like this, and changing it now would break things for a lot of people.

- Phil
Title: Re: -ext produces / on windows
Post by: StarGeek on July 16, 2024, 04:32:01 PM
You can always code the substitution directory in the -p (-printFormat) FMT string (https://exiftool.org/exiftool_pod.html#p-FMTFILE-or-STR--printFormat)

exiftool -m -p "${Filepath;s(/)(\\)g}" -ext JPG .
Title: Re: -ext produces / on windows
Post by: Bona Sierra on July 16, 2024, 04:41:06 PM
OK, thanks. I will then apply the workaround with the substitution.