I'm trying to create a workflow that will read certain metadata form files and dump the information on a txt file.
Here is the command I use:
"%comspec%" /c ""C:\MediaInfo-cli\MediaInfo.exe" "--Output=file://C:\MediaInfo-cli\template_mediainfo.txt" "%source%" >> "Z:\Mediainfo_All_Files.txt""
The issue I'm having is that since the SW is multi threading and runs in parallel in different computers some instances will try to append to the destination file, but since another instance is writing to it it fails, so I got the info of some files and no others.
Is there a way to wait for the file to be unlocked to write to it?
If you or someone else has a working solution can you share?
Command Executor cannot append file
Re: Command Executor cannot append file
btw, here is the template I'm using to get only the info I want:
General;%CompleteName% | %FileSize/String3% | %Duration/String%
Video; |Video: %Width%x%Height% | %DisplayAspectRatio/String% | %FrameRate%\n
General;%CompleteName% | %FileSize/String3% | %Duration/String%
Video; |Video: %Width%x%Height% | %DisplayAspectRatio/String% | %FrameRate%\n
Re: Command Executor cannot append file
Hi,
i don't know a direct way to wait for the file lock but you can reduce the time your text file is opened/locked from multiple minutes (currently your text file is locked while mediainfo is running) to a few milliseconds by setting the output of your mediainfo cmd to a variable first:
in a batch file:
direct usage without batch file:
(replace dir /s c:\ by your mediafino cmd)
cheers!
emcodem
i don't know a direct way to wait for the file lock but you can reduce the time your text file is opened/locked from multiple minutes (currently your text file is locked while mediainfo is running) to a few milliseconds by setting the output of your mediainfo cmd to a variable first:
in a batch file:
Code: Select all
FOR /F "tokens=* USEBACKQ" %%F IN (`dir /s c:`) DO (ECHO %%F>> c:\temp\out.txt)
Code: Select all
FOR /F "tokens=* USEBACKQ" %F IN (`dir /s c:`) DO (ECHO %F>> c:\temp\out.txt)
cheers!
emcodem
emcodem, wrapping since 2009 you got the rhyme?