develooper Front page | perl.perl5.porters | Postings from March 2016

[perl #127805] Let windows Perl programs call setvbuf on filehandles

March 31, 2016 13:48
[perl #127805] Let windows Perl programs call setvbuf on filehandles
Message ID:
# New Ticket Created by  Yary 
# Please include the string:  [perl #127805]
# in the subject line of all future correspondence about this issue. 
# <URL: >

An infrequently asked Perl5 question is how to adjust the read-ahead buffer for normal reads. Example discussions on the web include "4k read buffer is too small"

The best-documented answer these days is setvbuf as mentioned in the IO::Handle docs. However: "IO::Handle::setvbuf() is not available by default on Perls 5.8.0 and later" and indeed that's the case- it doesn't seem to be available on my Strawberry Perl 5.22, even if I open a handle with the ":stdio" layer.

Being able to adjust a filehandle's read-ahead buffer size is occasionally useful for some unusual scenarios. -> It would be great to provide a way to set the buffer size in IO::Handle with current Perl.

even if it isn't feasible to implement this feature request, there is now a layer module on CPAN that provides this- PerlIO::buffersize - perhaps that module could be mentioned alongside "setbuf" in the IO::Handle docs as an alternative. Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About