Open Process on OSX

Samuel M. Smith smithsm at samuelsmith.org
Tue Oct 18 14:55:32 EDT 2005


I can successfully open and read from a process but I can not get  
write to process to work on OS X 10.4.2
at least not all the way.

First if I open process with text then runrev converts newlines to  
carriage returns. This is
not correct for OS X. Especially unix processes which expect Unix  
newlines.

If I open with binary I can append newline characters numtochar(10)  
that will get sent OK.


The big problem is if I try to read in the process.

I am using a very simple test shell process

#!/bin/bash
#test.sh
echo "Hello there"
echo "Who are you?"
read DATA
echo "$DATA" > /Users/smithsm/Data/code/revolution/temp.txt
echo "$DATA"
echo "Goodbye"


This works from the command line in terminal

I put the process name into a text field named "Process"

I open it with

open process field "Process" for binary update

I read it with

read from process field "Process" until linefeed in 1 second
put the result into field "Result"
put it after field "BagRead"


I try to write with

put field "BagWrite" into bag
put bag & numtochar(10) into bag
write bag  to process field "Process"


The behavior is as follows:
I open the process ok
I read the first line ok
I read the second line ok
I write
I try to read the third line and the result is timed out
I never can read from the process once the process tries to read from  
runrev

The write was correctly received by the process because it gets  
written to the file in the process
However runrev doesn't manage reads by the process correctly since I  
can't read from the process by runrev
once the process tries to read from runrev.

Looks like a bug.

On 18 Oct, 2005, at 03:39, Mark Waddingham wrote:

> Hi Samuel,
>
> As of version 2.6.1 you can now use 'open process' with UNIX-style
> processes on OS X in the same way as on Unix/Linux and Windows.
>
> I'll make a note to update the documentation for the next release.
>
> Warmest Regards,
>
> Mark.
>
> ------------------------------------------------------------------
>  Mark Waddingham ~ 36degrees at runrev.com ~ http://www.runrev.com
>        Runtime Revolution ~ User-Centric Development Tools
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your  
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>

**********************************************************************
Samuel M. Smith Ph.D.
2966 Fort Hill Road
Eagle Mountain, Utah 84043
801-768-2768 voice
801-768-2769 fax
**********************************************************************
"The greatest source of failure and unhappiness in the world is
giving up what we want most for what we want at the moment"
**********************************************************************




More information about the use-livecode mailing list