comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: How to use the SPAWN pipe?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: How to use the SPAWN pipe? [message #36493] Tue, 23 September 2003 06:34 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Ricard Marxer writes:

> Having real problems with this pipe reading issue.
> I am able to read the first line of the output of my program (the program I
> spawned) but then the instruction "READF, Pipe, Line" seems to block. Is it
> because it doesn't detect the end of a line??? Can someone help me out with
> this one, please?

Reading information over pipes like this can
be difficult if you don't know what kind of
information is coming and going. In fact,
the processes on either side of the pipe can
inadvertently be put "to sleep" because they
are waiting for a piece of information. This
is likely what has happened to you. When that
happens, all is lost. :-)

The simple solution (although maybe not for you)
is to write the read/write portion of the code
in such a way that the programs on the other
end of the pipe know what is happening. In
practice this means sending the number of bytes
to read, then the bytes themselves. This makes
sure the bytes on the pipe are always consumed,
and prevents the pipe from "freezing".

Cheers,

David

--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
[Message index]
 
Read Message
Read Message
Previous Topic: How to use the SPAWN pipe?
Next Topic: lens distortion

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 02:29:05 PDT 2025

Total time taken to generate the page: 0.95629 seconds