Leon Timmermans writes:
> On Wed, Feb 4, 2009 at 4:37 PM,  <pugs-comm...@feather.perl6.nl> wrote:
> > +=item method IO dup()
> Do we really want that?

If we label a thing as "POSIX", it should certainly make all the POSIX
functionality available, IMHO.  I'd consider arguments that we should
pick different names for specific functions where the POSIX names are
particularly awkward, but I think a good default would be to match the
names as well.  Or else avoid the label "POSIX".

> POSIX' dup does something different from what many will expect. In
> particular, the new file descriptors share the offset, which can
> result in some really confusing situations.

To my knowledge, there's no alternative -- that is, there's no POSIX
functionality which allows the creation of a file descriptor open on
the same underlying object as an existing fd, but with its own file
offset.  Assuming I'm right, that doesn't mean users shouldn't get
access to POSIX dup() for when it *is* what they want.

I agree that also providing a less surprising method would be a good
thing, assuming it can be widely implemented.  But it needn't live in

Aaron Crane ** http://aaroncrane.co.uk/

Reply via email to