How to change output file name while -stay_open true?

Started by dc@eicx.com, January 06, 2021, 04:33:58 PM

Previous topic - Next topic

dc@eicx.com

How to change output file name while -stay_open true?

Is there a way to close the output file and open a new one while using -stay_open?


Phil Harvey

What do you mean by "the output file"?  And how did you open 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 ($).

dc@eicx.com

By output file I am referring to the file I am piping the image meta data to.

I guess I can't change that as it is an OS thing not exeftool thing.

This works great!
C:\EXIFTOOL_TOOL>exiftool -stay_open 1 -@ ->output.txt \n
test.jpg \n
-execute \n
-stay_open \n
0 \n

However the output.txt file is locked by the OS so I can't read it from my application after each -execute.

So my question is can I give each image.jpg the exiftool reads a different file with the results?

So for example pix_999.jpg could put it's metadata into pix_999.txt (or any other file extension)





dc@eicx.com

What I am really trying to do is call exftool like it was a set of functions in a dll.

Start it up

Send in file names a bunch of times and get the results

Shut it down

I am using the PowerBasic compiler and have not been able to get your C++ object working in my environment.

Perhaps I should try it in Perl!

Phil Harvey

First, you should be able to read and output file while it is being written.  You certainly can do this on Mac/Linux.

But you don't need to use an output file.  All you need to do is to pipe exiftool's stdout directly to your program.  In C this is easy enough, and you should be able to find some examples of how to do this using PowerBasic.

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