read from process ?stderr?

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
Kevin
Posts: 74
Joined: Fri Oct 02, 2009 3:47 pm

read from process ?stderr?

Post by Kevin » Tue May 12, 2020 6:04 pm

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

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10082
Joined: Fri Feb 19, 2010 10:17 am

Re: read from process ?stderr?

Post by richmond62 » Tue May 12, 2020 7:42 pm

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

Kevin
Posts: 74
Joined: Fri Oct 02, 2009 3:47 pm

Re: read from process ?stderr?

Post by Kevin » Wed May 13, 2020 3:09 am

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

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10043
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: read from process ?stderr?

Post by FourthWorld » Wed May 13, 2020 3:33 am

Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10082
Joined: Fri Feb 19, 2010 10:17 am

Re: read from process ?stderr?

Post by richmond62 » Wed May 13, 2020 8:09 am

FourthWorld wrote:
Wed May 13, 2020 3:33 am
Maybe this?:

Code: Select all

command-name 2>&1
https://www.cyberciti.biz/faq/redirecti ... to-stdout/
Can you do that inwith LiveCode?

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10043
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: read from process ?stderr?

Post by FourthWorld » Wed May 13, 2020 9:01 am

Are you using the shell function to call your CLI process?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10082
Joined: Fri Feb 19, 2010 10:17 am

Re: read from process ?stderr?

Post by richmond62 » Wed May 13, 2020 10:23 am

Code: Select all
command-name 2>&1
Um . . .
redirecting to a file is not acceptable

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10043
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: read from process ?stderr?

Post by FourthWorld » Wed May 13, 2020 4:09 pm

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.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

Post Reply