ExifTool Forum

ExifTool => Newbies => Topic started by: dc@eicx.com on January 06, 2021, 04:33:58 PM

Title: How to change output file name while -stay_open true?
Post by: dc@eicx.com on January 06, 2021, 04:33:58 PM
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?

Title: Re: How to change output file name while -stay_open true?
Post by: Phil Harvey on January 06, 2021, 08:49:51 PM
What do you mean by "the output file"?  And how did you open it?

- Phil
Title: Re: How to change output file name while -stay_open true?
Post by: dc@eicx.com on January 06, 2021, 10:07:13 PM
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)




Title: Re: How to change output file name while -stay_open true?
Post by: dc@eicx.com on January 06, 2021, 10:12:20 PM
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!
Title: Re: How to change output file name while -stay_open true?
Post by: Phil Harvey on January 07, 2021, 08:08:46 AM
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
Title: Re: How to change output file name while -stay_open true?
Post by: dc@eicx.com on January 07, 2021, 11:19:45 AM
Thank you,
I will keep at it.