Using -@ in stay_open mode possible?

Started by BogdanH, November 14, 2011, 12:31:43 PM

Previous topic - Next topic

BogdanH

Hi Phil,
Question: If ExifTool is in stay_open mode and write/read goes via StdIn/StdOut, is it possible to use -@ option for arg file? -so, in arg file, filenames (of files to be processed) would be listed. That would avoid sending a lot of filenames to StdIn. I know, I could tryout... but wish to be sure if that's possible (in case, I get "unexpected" results by trying).
I don't know yet, if I will need this option at all -I just wish to be prepared.

And I'll use the oportunity:
From my point of view, stay_open is very "special" ExifTool mode, which opens some special wishes  :) Here I go..
I miss the option, where I could set some default settings, which would be valid as long ExifTool is running (in stay_open), or if (some of) settings are changed later. Settings I have in mind are i.e: -m -P -sep -ext etc. That is, once I set i.e. -sep *, this separator will be used regardles of how many -execute's I use later.
Or... is that allready possible to achieve somehow with -common_args option??

Bogdan

Phil Harvey

Hi Bogdan,

Yes, you may use -@ recursively inside argfiles.

Using -common_args won't quite do what you want, but I may be able to add this feature.  Let me think about it.

- 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

It seems that -common_args will do this.  But you must be careful to put -common_args after -@ on the original command line.

The first time I tried, I did this:

exiftool -common_args -m -P -stay_open true -@ a.args

But that was a disaster because the "-@ a.args" was common to all commands so it got into a recursive processing loop... Ooops!  (You must also watch out for this when using -@ from within an argfile -- be sure it is a different argfile or you will get into a recursive loop!)

However, this does work:

exiftool -stay_open true -@ a.args -common_args -m -P

Cool.

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

BogdanH

Hi Phil,
Quote from: Phil Harvey on November 14, 2011, 01:41:03 PM
It seems that -common_args will do this.  But you must be careful to put -common_args after -@ on the original command line.
...because:
Quote
However, this does work:

exiftool -stay_open true -@ a.args -common_args -m -P
... -common_args parameters are comming after -@ a.args and are thus valid for whatever it's inside "a.args" file.

But that's not what I had in mind. Just assume I'm not using -@ a.args at all (I'm using StdIn instead). So, what I do first is, I prepare pipes and call ExifTool from my app:
exiftool -stay_open true -
From now on, ExifTool is waiting for data on StdIn. If I send, i.e.:
-xmp:subject/n
MyFile.jpg/n
-execute/n

...I get expected result.
What I would like to do is, send something like:
-default_args/n -just invented the name :)
-sep/n
*/n
-execute/n

After that, * separator would be in use as long ExifTool runs (or until I replace separator character). That is, I would like ExifTool would remember settings. As it is now, everytime some command is executed, various options must also be sent. Most of these options usually don't change that often or are even valid the whole session (i.e. -Lang settings).
Of course, all above could only be of benefit if ExifTool is running in stay_open mode.

Bogdan

Phil Harvey

Hi Bogdan,

I understand.  No, there is nothing that will allow you to do this.

But from your end, the only difference would be a very few extra bytes sent to exiftool for each command executed, so I don't really see this as a big problem.

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

BogdanH

Hi Phil,

No, this really isn't a problem -sorry if sounded that way. I was just thinking, maybe there's some trick to do that.

Bogdan