On Thu Nov 17 08:10:58 2005, [email protected] wrote: > On 11/12/05, chromatic <[email protected]> wrote: > > Hi there, > > > > I'd like to change where print output and warnings and errors go within > > a section of PIR code, like you can change them in C and Perl by closing > > and reopening the file descriptor or localizing the typeglob, > > respectively.
The simple solution is to add opcodes for 'setstdin', 'setstdout', and 'setstderr' that change the interpreter's stored FileHandle PMCs to a PMC passed in as an argument. This will not effect any C code that directly calls the low-level read/write functions instead of using the Parrot_io_* functions, but then C code should pretty much always use the Parrot_io_* functions. (Some exceptions to the general rule apply, like when the code specifically needs to override any user changes to STD[IN|OUT|ERR]). Allison _______________________________________________ http://lists.parrot.org/mailman/listinfo/parrot-dev
