Space in Directory name = file not found for some operations

Started by antkent, January 07, 2021, 09:38:53 PM

Previous topic - Next topic

antkent

Most operations work when there is a space in the target Directory name, but results in "file not found" for some (but not all) operations

Example: exiftool -L -d %Y "-rights<©$DateTimeOriginal, First Last. All Rights Reserved." -r C:\Motorsports\2003\ChampCar\St Pete

Result: Error: File not found - C:/Motorsports/2003/ChampCar/St

Not sure if this is an OS issue, but seems like it should not be.

Phil Harvey

You need quotes around any command-line argument that contains spaces.

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

Alan Clifford

QuoteC:\Motorsports\2003\ChampCar\St Pete

How do you expect the operating system to know that that is an entity called "St Pete", rather than two entities called "St" and "Pete" when the operating system uses the space character to keep such entities separate?

StarGeek

"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

jeff_k

Oddly, I am still seeing this error even when quoting the directory path.

Command:
exiftool -@ ~/vsco_exif.txt

Contents of vsco_exif.txt:
-r
-d
%Y-%m/%Y-%m-%d at %H-%M-%S
-filename<$createdate - Unknown%-c.%e
-filename<$createdate - ${model;s/\//-/}%-c.%e
-filename<$datetimeoriginal - Unknown%-c.%e
-filename<$datetimeoriginal - ${model;s/\//-/}%-c.%e
-filename<$datetimeoriginal.${subsectimeoriginal;$_='0'x(3-length).$_} - Unknown%-c.%e
-filename<$datetimeoriginal.${subsectimeoriginal;$_='0'x(3-length).$_} - ${model;s/\//-/}%-c.%e
"/volume1/gen testing/vsco_testing/"


Results:
Warning: Error opening file - "/volume1/gen testing/vsco_testing/"
Error: File not found - "/volume1/gen testing/vsco_testing/"
    0 image files updated
    1 files weren't updated due to errors


Am I missing something?

StarGeek

"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

jeff_k

Thank you...I should've mentioned: I had already included it without the quotes and with \ to escape the space in the directory name, but I still got file not found.
(i.e. I used /volume1/gen\ testing/vsco_testing/ without any quotes but still got the same error message)


StarGeek

Escaping spaces is part of shell.  You do not use quotes nor do you escape any characters in an arg file.
/volume1/gen testing/vsco_testing/

Edit: From the docs on the -@ (Argfile) option
     Normal shell processing of arguments is not performed, which among other things means that arguments should not be quoted and spaces are treated as any other character
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

jeff_k