Using -stay_open with stream

Started by aradeonas, November 14, 2015, 05:16:24 AM

Previous topic - Next topic

aradeonas

Hi,

With some try now I can use ExifTool with -stay_open option and everything is good.
I add these parameters:
'-stay_open'
'true'
'-@'
'-'

and then I excute it.
For getting Metadata I will add -s and filename each one with a LineEnding and then I pass -execute with LineEnding and I will check output and everything works.

So Now I want to pass stream not filename to ExifTool but if I write stream to input with or without LineEnding I will not get any output and it will freeze.
If Im doing it wrong or it doesnt support file stream please tell me and if not is there any example anywhere for it?

Phil Harvey

You are using the stdin stream for commands, so it can't be used for the file too.  The commands must come from the command line or a disk file if you want to stream the image data.

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

aradeonas

Sure I do!
I managed to use it with stream without -stay_open option.
I send stream to stdin an close the input and wait for result and get stdout but with -stay_open option and passing -execute with LineEnding it will never give me any result.
I just did what I did before -stay_open option and if I pass file name before execute it works very good but if I write file in input and pass execute nothing will happen.
Am I doing something wrong or miss something?
Is there any working demo in any language like C,C++,Java,Delphi,Pascal or anything I can learn from it?

Phil Harvey

You missed something:  The -stay_open option keeps the input open for command-line arguments.

I wrote a C++ wrapper class that uses the -stay_open option here.

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

aradeonas

Yes I know that and I dont close it but my problem is :
When I pass all parameters except file I will have 2 options:
1-pass the file name with LineEnding and then pass -execute with LineEnding. Everything will work and its OK.
2-pass file stream and then pass -execute with LineEnding. nothing happen and there is no result. I also tested without LineEnding and nothing happen again.
Also I saw your code and it use filename and my question is :
How can I pass file stream (not file name) to ExifTool in StayOpen mode and is there any sample in any language?

Phil Harvey

You keep asking the same question, so my answer will be the same.  I think we have a communication 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 ($).

aradeonas

QuoteYou missed something:  The -stay_open option keeps the input open for command-line arguments.
You said it keeps input open and I know that but how is effects sending file stream? Or asking like this,can I send file stream and if yes how?

Thanks for your ExifTool and helps.

Phil Harvey

You can't send your command-line arguments via the same stream as your file if you want the argument stream to stay open.

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

aradeonas

So with ExifTool stay-open option w can not send stream of file an just file name accepted .
It what I understand from your answer and the fact that I could find any demo or example.