New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IO::Handle's error() method does not accurately reflect write errors #12783
Comments
From tchrist@perl.comThe documentation for IO::Handle reads: $io->error However, this is not true. For example, a failed write on a given handle syswrite failed, errno was ENOSPC (28): No space left on device Tested on v5.8.8 up through blead. --tom #!/usr/bin/env perl use v5.6; use Carp; use constant { main(); sub main { ########################################################################## sub test_file { sub test_write { my $reopen = sub { sysopen($path_fh, $path_name, O_WRONLY | O_APPEND) my $string = "[this is the line of test data]\n"; my $slen = length($string); print "\ntesting syswrite\n"; &$reopen; my $written = syswrite($path_fh, $string, $slen); my $reclose = sub { &$reopen; my $ok = print $path_fh $string; if ($has_error) { $good_writes = $ok; } sub fmt_bool { sub fmt_undef { BEGIN { my @_Errno2Sym; sub fmt_errno { } __END__ testing syswrite testing print That's all, folks! ================================================================ Summary of my perl5 (revision 5 version 16 subversion 0) configuration: Platform: Characteristics of this binary (from libperl): |
From @jkeenanOn Sun Feb 17 15:16:54 2013, tom christiansen wrote:
Confirming that I got the same output as Tom on Linux/i386. jimk |
The RT System itself - Status changed from 'new' to 'open' |
I don't think so. Somewhat to my surprise, I found Tom's test program on my server exactly where I placed it 11 years ago. I ran it and got what appear to be the same results as I did then and as Tom did.
That suggests to me that the problem is still present, hence the ticket is not closable. |
Migrated from rt.perl.org#116807 (status was 'open')
Searchable as RT116807$
The text was updated successfully, but these errors were encountered: