Page 1 of 1
read from process ?stderr?
Posted: Tue May 12, 2020 6:04 pm
by Kevin
Hi, I am looking for a built-in command or function to read from the stderr of another process. I am unable to locate anything in the dictionary or various web-sites. I realize I can redirect stderr to stdout however this would vastly complicate the application.
Thanks in advance for any assistance,
K
Re: read from process ?stderr?
Posted: Tue May 12, 2020 7:42 pm
by richmond62
You can direct your
stderr to a text file which can then be read into a LiveCode field or variable.
https://www.computerhope.com/jargon/s/stderr.htm
Re: read from process ?stderr?
Posted: Wed May 13, 2020 3:09 am
by Kevin
Thanks, however redirecting to a file is not acceptable for this implementation as all the standard pipes are streaming. I guess I will look into the FFI I have been reading about. I believe the official product is called LiveCode Builder. It would be interesting to use it for loading dynamic libs (DLLs in windows) ldsym, dlopen etc.? I have used binaryEncode and binaryDecode which is similar to pack and unpack methods I have used in other programming languages. So, the concepts are not foreign to me. If you have any further suggestions they would be appreciated.
Thanks!
K
Re: read from process ?stderr?
Posted: Wed May 13, 2020 3:33 am
by FourthWorld
Re: read from process ?stderr?
Posted: Wed May 13, 2020 8:09 am
by richmond62
Can you do that inwith LiveCode?
Re: read from process ?stderr?
Posted: Wed May 13, 2020 9:01 am
by FourthWorld
Are you using the shell function to call your CLI process?
Re: read from process ?stderr?
Posted: Wed May 13, 2020 10:23 am
by richmond62
Code: Select all
command-name 2>&1
Um . . .
redirecting to a file is not acceptable
Re: read from process ?stderr?
Posted: Wed May 13, 2020 4:09 pm
by FourthWorld
Hmmm... Is that the full error message?
Do you also get that error message in terminal?
It could be the tutorial I linked to is wrong, but it would be good to see the script you used to produce that error.