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

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

Nick Ing-Simmons
June 16, 2003 00:27
Re: [perl #22339] IO::Handle::setvbuf not defined properly
Message ID:
Mark Jason Dominus <> 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 Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About