× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.




Hi Guys,

OK, I was toying with the idea of using a pipe to pass data from one program to another. The idea was that PGM1 would write to the pipe and PGM2 would read from it - both in the same job. The idea was that in this particular case we could use a pipe in place of a pointer - no need to allocate/reallocate/deallocate or keep track of size. I got an example working nicely, as we already have code using pipes for inter-process communications. However, there would seem to be a 32k limit on the pipe which puts a severe restriction on it.

So I thought - hang on! What about using STDIN and STDOUT. So I knocked up a simple test program to read from a IFS file, write to STDOUT and then read from STDIN and write out to another IFS file. But I am having a problem on the write to STDOUT. I have the file descriptor set to 1 but I'm getting rc2 = -1 and an errno = 3455 (broken pipe).

Any ideas why the write to fd 1 would cause a broken pipe error? My understanding is that fd 0, 1, 2 are reserved for STDIN, STDOUT, & STDERR respectively.

Example snipped for context. The prototypes are from IFSIO_H and data is a 512a field. The read is retrieving 512 bytes and rc1 = 512.

<snip_of_code>
rc1 = read(fd1 :%addr(data) :%size(data));
dow rc1 > 0;
rc2 = write(1 :%addr(data) :rc1);

rc1 = read(fd1 :%addr(data) :%size(data));
enddo;
</snip_of_code>

Of course, if STDIN and STDOUT have a similar size restriction to pipes we may just use a pointer or a temporary stream file.

Your guidance would be most appreciated.

Cheers

Larry Ducie

_________________________________________________________________
Windows Live Messenger treats you to 30 free emoticons - Bees, cows, tigers and more!
http://livelife.ninemsn.com.au/article.aspx?id=567534

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.