Hello,
I'm writing a single procedure that handles a few commands (a, x and l) of 7z.exe for the exploitation of more than 100k archives.
There's a question on my mind: Does multiplying the test lines within a 'While ProgramRuning()' and processing the retrieved strings with ReadProgramString() somehow slow down the execution of 7z and, more generally, any program run in this way?
I'm wondering whether I should create a procedure for each type of 7z command (with redundant tests and processing) or a single procedure with all the tests and processing.
As you can see, the aim of all this is to make the procedure(s) run as quickly as possible.
Thanks.
[ANSWERED] Technical question about RunProgram() and related functions
[ANSWERED] Technical question about RunProgram() and related functions
Last edited by boddhi on Sat Feb 17, 2024 1:30 pm, edited 1 time in total.
If my English syntax and lexicon are incorrect, please bear with Google translate and DeepL. They rarely agree with each other!
Except on this sentence...
Except on this sentence...
Re: Technical question about RunProgram() and related functions
In general it should not slow down your external program.
The program writes to stdout or stderr. These devices are buffered and writing does not block.
But you should not use ReadProgramString()
Use ReadProgramData() instead, with the AvailableProgamOutput() length.
The program writes to stdout or stderr. These devices are buffered and writing does not block.
But you should not use ReadProgramString()
Use ReadProgramData() instead, with the AvailableProgamOutput() length.
Re: Technical question about RunProgram() and related functions
Hello Infratec,
Thanks for your reply.
That's what I thought, but it removes any doubt.
But... it also raised another question:
The data retrieved are simple text strings (non-binary data). It seems simpler to me, but maybe I'm wrong...
Thanks for your reply.
That's what I thought, but it removes any doubt.
But... it also raised another question:
Why should ReadProgramData() be preferred to ReadProgramString() if the latter exists?infratec wrote: But you should not use ReadProgramString()
Use ReadProgramData() instead, with the AvailableProgamOutput() length.
The data retrieved are simple text strings (non-binary data). It seems simpler to me, but maybe I'm wrong...
If my English syntax and lexicon are incorrect, please bear with Google translate and DeepL. They rarely agree with each other!
Except on this sentence...
Except on this sentence...
Re: Technical question about RunProgram() and related functions
ReadProgramString() blocks your code. If there comes something on stderr, you don't read it until the stdout line is completed.
And if you get a process progess via xx% you get no CRLF, because this is done via BS or via cursor movement.
So you don't get the progress.
I only use ReadProgramString() if I 100% know how the other program makes his output.
Normally when the program is from me
And if you get a process progess via xx% you get no CRLF, because this is done via BS or via cursor movement.
So you don't get the progress.
I only use ReadProgramString() if I 100% know how the other program makes his output.
Normally when the program is from me
Re: Technical question about RunProgram() and related functions
Thanks for the technical information, which I'll take into consideration.
I'm not very familiar with the use of RunProgram() but all the times I've used it, I've never had a problem. So I just kept on doing it that way.
I'm not very familiar with the use of RunProgram() but all the times I've used it, I've never had a problem. So I just kept on doing it that way.
If my English syntax and lexicon are incorrect, please bear with Google translate and DeepL. They rarely agree with each other!
Except on this sentence...
Except on this sentence...

