develooper Front page | perl.perl5.porters | Postings from June 2003

Re: [perl #22339] IO::Handle::setvbuf not defined properly

From:
Nick Ing-Simmons
Date:
June 16, 2003 00:27
Subject:
Re: [perl #22339] IO::Handle::setvbuf not defined properly
Message ID:
20030616072715.1635.1@bactrian.elixent.com
Mark Jason Dominus <mjd@plover.com> writes:
>You said:
>> 
>> seek(FH,0,1);  # re-position here
>> 
>> Will discard the buffer contents on a read stream.
>
>Is that guaranteed to work on all platforms, all implementations,

Not yet obviously or we would not have this thread.

But is guaranteed to work on a :unix:perlio stream.

>forever?  I don't expect so.  The 'correct' solution would seem to be
>to use 'setvbuf', which is part of the C standard.

But PerlIO is not a C standard. 

There may be no stdio involved at all.

Personally I refuse to adopt a setvbuf() style API which packs too 
many options into its args - including some which expose addresses
of buffers which is not perl friendly.


-- 
Nick Ing-Simmons
http://www.ni-s.u-net.com/




nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About