Using Unix FIFO files

Mike Bonner bonnmike at gmail.com
Thu Jan 12 14:32:05 EST 2012


Just did a small amount of reading on fifo (new stuff for me) looks like
theres a blocking mode and a non-blocking mode.
http://linux.die.net/man/7/fifo  has a little bit of info on this, no real
answer, but I wonder if thats part of the issue. If your process opens them
in blocking mode, that might be part of the issue.  I wonder if you should
"open file for read" and "open file for write" to make this work better.
 IE open them with lc so you have your file handles, then start your shell
process. (though unless you are backgrounding or disconnecting the shell
process, I think its blocking which also might be part of the issue, so you
might use "open process" to start the shell process also. Then, since
you're redirecting your input and output from the started process you don't
have to worry about opening the process for read, write, or update since
you won't be reading or writing directly to it.

As far as that goes, since the fifo files are only acting as pass-throughs,
can you bipass the whole fifo thing and just "open process for update" and
then read/write to and from it as necessary?

Hopefully a heavier hitting unix-head will chime in, but maybe something
here will point you towards an answer.

On Thu, Jan 12, 2012 at 11:44 AM, Pete <pete at mollysrevenge.com> wrote:

> Anyone tried to use FIFO files from within LC? I'd like to use them to
> communicate with a Unix process from LC but not having any luck
>
> I create two fifo files using the Unix mkfifo command. That works fine.
>  The plan is to start the Unix process with the shell command, redirecting
> it's stdin to one of the fifo files and its stdout to the other fifo file,
> write a command to the stdin file, then read the output from the stdout
> file.  No matter what order I do things in, LC hangs on either the put URL,
> get URL, or shell command to start the process.
>
> I think I'm probably out of luck but maybe someone who knows more about
> Unix than I can help?
>
>
> --
> Pete
> Molly's Revenge <http://www.mollysrevenge.com>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>



More information about the use-livecode mailing list