> Therefor I propose: > Remove the integer-valued File-Descriptors. The ParrotIO-objects > (wrapped in PMCs) are the only way to access IO. The > standard-descriptors stdin/stdout/stderr can be obtained by new ops > get_stdin (out PMC) > get_stdout (out PMC) > get_stderr (out PMC) > respectivly the macros > PIO_STDIN(interpreter); > PIO_STDOUT(interpreter); > PIO_STDERR(interpreter); > > If communication with external file-descriptors is necessary then the > PIO_fdopen function should be used, and the result is again a > ParrotIO-object.
Nice thoughts and probably the right direction. I'm a little vague on it's external interface though. What would the PMC interface look like from the PIR level? new Px, ParrotIO [... open the handle or whatever ...] set Ix, Px # Get the FD number? What about the other way around for those interfaces which require the programmer to give up the file descriptor directly, like ioctl() or fcntl()?