From: Reinhard M. <ma...@tc...> - 2009-09-02 14:56:16
|
On Wed, 2 Sep 2009 at 16:14, Alexandre Ferrieux wrote: > then yes, of course it will work exactly the same, since "stdout" is > a special alias mapping to fd 1 in all cases, *and* the allocation > of fds remains the OS's job. The only difference is that the handle > name returned by the [open] above will likely be "file345" rather > than "file1", but who cares ? This brings up the question (though outside the scope of this TIP), whether re-opened file descriptors 0, 1 and 2 should always get the channel names stdin stdout and stderr instead of the current file[012] or the proposed file$n, so that e.g. library code has a chance to use the standard channels by their standard names, even if they were closed and reopened. Back to this TIP: It might be a good idea to let the new channel counter start at numbers that are higher than any file descriptor number on Unix can ever be* to avoid confusion, e.g. with dynamically loaded channel drivers that might still use the system fd number to create the channel name. *) If that number can be determined at all, otherwise use a number that can be assumed to be above what one will typically see on a real-life system. cu Reinhard |