To: Graham Barr <gbarr@pobox.com>
cc: Vicki Brown <vlb@cfcl.com>, perl5-porters@perl.org, mjd@plover.com
Subject: Re: [ID
19990811.002] can't dup DATA? (PATCH (5.005_57))
Date: Wed, 11 Aug 1999 15:56:09 -0400
Message-ID: <
19990811195610.5933.qmail@plover.com>
From: Mark-Jason Dominus <mjd@plover.com>
To: perl5-porters@perl.org
Subject: Re: [ID
19990811.002] can't dup DATA? (PATCH (5.005_57))
Date: Wed, 11 Aug 1999 16:05:46 -0400
Message-ID: <
19990811200546.6165.qmail@plover.com>
p4raw-id: //depot/cfgperl@3960
goto say_false;
}
if (IoIFP(thatio)) {
- fd = PerlIO_fileno(IoIFP(thatio));
+ PerlIO *fp = IoIFP(thatio);
+ /* Flush stdio buffer before dup */
+ PerlIO_seek(fp, 0, SEEK_CUR);
+ fd = PerlIO_fileno(fp);
if (IoTYPE(thatio) == 's')
IoTYPE(io) = 's';
}
were opened only for writing will now produce warnings (just as
writing to read-only filehandles does).
+=head2 Buffered data discarded from input filehandle when dup'ed.
+
+C<open(NEW, "E<lt>&OLD")> now discards any data that was previously
+read and buffered in C<OLD>. The next read operation on C<NEW> will
+return the same data as the corresponding operation on C<OLD>.
+Formerly, it would have returned the data from the start of the
+following disk block instead.
+
=head1 Supported Platforms
=over 4