[FFmpeg-devel] Windows deprecated stdin reading method

Peter dravorek at googlemail.com
Sun Mar 8 12:09:42 CET 2015


alright, that table didn't work out, just imagine this:

.\test.exe <a.txt                         input ignored
type a.txt | .\test.exe                   works
.\test.exe <a.txt                         input ignored
cat a.txt | .\test.exe                    works
Get-Content input-file.txt | .\test.exe   works
.\test.exe <a.txt                         input ignored
cat a.txt | .\test.exe                    works

across both approaches

2015-03-08 12:07 GMT+01:00 Peter <dravorek at googlemail.com>:
> So testing on Windows 8.1 the results seem identical
>
> ||shell            ||command
> ||stdin->_cnt > 0||WaitForSingleObject||
> ||=================||=========================================||===============||===================||
> ||cmd.exe          || .\test.exe <a.txt                       || input
> ignored || input ignored     ||
> ||cmd.exe          || type a.txt | .\test.exe                 || works
>         || works             ||
> ||msys/cmd.exe     || .\test.exe <a.txt                       || input
> ignored || input ignored     ||
> ||msys/cmd.exe     || cat a.txt | .\test.exe                  || works
>         || works             ||
> ||powershell       || Get-Content input-file.txt | .\test.exe || works
>         || works             ||
> ||cygwin/mintty.exe|| .\test.exe <a.txt                       || input
> ignored || input ignored     ||
> ||cygwin/mintty.exe|| cat a.txt | .\test.exe                  || works
>         || works             ||
>
> I'm not sure I'm doing the redirection right. If there's something
> else that I need to test
> I would appreciate some input (no clue what can reasonably passed as
> stdin to CreateProcess
> or whether testing that is necessary)
>
> Also, very crucially, I just checked if any of these methods actually
> triggered either condition
> and none of the things I tried actually entered  the body of the if-check.
>
> Is there anything that would normally trigger the "stdin->_cnt > 0" in
> that location ?
>
> 2015-03-08 2:25 GMT+01:00 Peter <dravorek at googlemail.com>:
>> Sadly it seems WaitForSingleObject behavior with FILE handles is
>> not well defined behavior either, I think I've read the words "strongly
>> discouraged"
>>
>> I'm probably still gonna do some more tests to see if it actually breaks
>> under some circumstances. But this is not the golden ticket solution
>> either it seems.
>>


More information about the ffmpeg-devel mailing list