Interactive Long Running Shell process?

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Timpraetor
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9
Joined: Thu Feb 04, 2010 7:12 pm

Interactive Long Running Shell process?

Post by Timpraetor » Thu Feb 04, 2010 7:34 pm

HI Folks,

I looked at Revolution back in the 2.x time frame, but the lack of an asynchronous shell option prevented me from moving forward. Has anything changed in the new Revolution Studio or Enterprise versions?

To clarify my needs, I start an execv process in my Xlib code and get the output from the child process to update the contents of the UI. This process can run from a few milliseconds to days and the amount of data output could climb into the 100's of GiB, so writing to disk and reading from a file descriptor is not a good option.

What I need is something like popen and dup2'd stdin / stdout / stderr handles or tcl's fileevent.

Can I get there with the new stuff (I'm hoping to move some old X11 code to OS X and Windows)?

Thanks,
Tim
--
Tim

Tim Jones
President / CTO
TOLIS Group, Inc.
http://www.tolisgroup.com
http://ww2.productionbackup.com

Janschenkel
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 977
Joined: Sat Apr 08, 2006 7:47 am
Contact:

Re: Interactive Long Running Shell process?

Post by Janschenkel » Fri Feb 05, 2010 4:55 pm

Can you do it with the open process, write to process, read from process and close process commands?

Jan Schenkel.
Quartam Reports & PDF Library for LiveCode
www.quartam.com

massung
Posts: 93
Joined: Thu Mar 19, 2009 5:34 pm

Re: Interactive Long Running Shell process?

Post by massung » Fri Feb 05, 2010 6:26 pm

Tim,

Jan is definitely pointing you in the right direction. I don't know your application use, but know that I use this for hours on end communicating with a running SBCL process and have never had a problem with it.

Jeff M.

Timpraetor
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9
Joined: Thu Feb 04, 2010 7:12 pm

Re: Interactive Long Running Shell process?

Post by Timpraetor » Thu Feb 11, 2010 9:56 pm

Jeff and Jan,

So that is the new "goodie" I was looking for. When I asked before (back around 2.5), we were looking at the "shell" object and there was no way the execute a command-line helper program that required regular updating of the UI elements over a long period. While the back-end tool was running, there was no way to update the UI.

Are there any code examples? A quick search turned up nothing on my end.

Thanks,
Tim
Last edited by Timpraetor on Fri Feb 12, 2010 12:32 am, edited 1 time in total.
--
Tim

Tim Jones
President / CTO
TOLIS Group, Inc.
http://www.tolisgroup.com
http://ww2.productionbackup.com

Timpraetor
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9
Joined: Thu Feb 04, 2010 7:12 pm

Re: Interactive Long Running Shell process?

Post by Timpraetor » Thu Feb 11, 2010 10:07 pm

Even more curiosity - examining the docs/dictionary, it appears that these functions actually were around in the "olden" days. It's too bad someone didn't associate what I'd originally asked back then with the "process" commands as I've stayed away from Revolution because of this apparently missing feature. :(

For historical (or hysterical) purposes, my original question was support ticket number 2006072010000796.

Looks like I've got some catching up to do :oops: .
--
Tim

Tim Jones
President / CTO
TOLIS Group, Inc.
http://www.tolisgroup.com
http://ww2.productionbackup.com

Janschenkel
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 977
Joined: Sat Apr 08, 2006 7:47 am
Contact:

Re: Interactive Long Running Shell process?

Post by Janschenkel » Mon Feb 15, 2010 7:25 am

Well, process communication is 'blocking' - in the sense that when you read from process your Rev app is 'stuck' until it receives data from the other process - likewise, it is 'stuck' when you write to process until the process receives that data. So you have to design your interaction correctly to avoid stalling both processes. It would be great if process communication could use callbacks, like socket communication. Oh well, maybe someday :-)
Other than that, it works fine, and is one of the ways I demonstrated you can interact with Java processes at the RunRevLive'09 conference - you can download the slide show and example code here: http://www.quartam.com/downloads.html

HTH,

Jan Schenkel.
Quartam Reports & PDF Library for LiveCode
www.quartam.com

Post Reply