[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
pipe() function in syscalls.cc
From: |
John W. Eaton |
Subject: |
pipe() function in syscalls.cc |
Date: |
Fri, 11 Oct 2002 15:31:05 -0500 |
On 11-Oct-2002, Steve Lipa <address@hidden> wrote:
| It turns out that fid[0] in syscalls.cc consistently contains the correct
| descriptor. My problem was that I was telling the other process to read
| from fid[0] and telling Octave to write to fid[1] instead of telling it to
| write to the file associated with fid[1]. I simply didn't think hard
| enough about the error message which was telling me exactly what I was
| doing wrong.
Right, I don't think there is any guarantee that the file id number
Octave uses will match the Unix file descriptor number (if there even
is one on your system -- what would Windows do?). Octave uses the C++
I/O library, so I don't think there is any standard way to extract a
file number from an iostream object. So I could provide a fileno
function that would return Octave's file id number, but it would
probably just cause more confusion since the numbers it returns may
not match up with the OS file descriptors.
jwe