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
bad file descriptor after failed read #11973
Comments
From @ig3Created by @ig3I was surprised to find that after a failed read on a file descriptor What I expected was that the read would fail (because the file was Checking with Process Monitor (I saw this behavior on Windows 7), I The context where this arose is a subroutine passed a file descriptor. The subroutine The attached test demonstrates the behavior. Perl Info
|
From @ig3#!C:/strawberry/perl/bin/perl.exe use Test::More tests => 11; my $file = 'test.txt'; ok(open(my $fh, '>', $file), "open $file for writing") or diag("$file: $!"); ok(print($fh "test file"), "write some text to $file") or diag("$file: $!"); { ok(seek($fh, 0, 0), "seek back to beginning of file") or diag("seek failed: $!"); { cmp_ok($pos, '==', 0, "confirm position after seek"); { ok(!defined($count), "read should fail, returning undef"); { cmp_ok($pos, '==', 0, "confirm position after read"); ok(print($fh "write more"), "write more text to $file after failed read") or diag("$file: $!"); ok(close($fh), "close $file") or diag("$file: $!"); |
From @LeontOn Sun, Feb 26, 2012 at 7:53 AM, ian.goodacre@xtra.co.nz <
I have recently discovered the same issue, while finding an explanation for
That is correct too. I have a pretty good idea of how to fix, but I hadn't Leon |
The RT System itself - Status changed from 'new' to 'open' |
From @cpansproutOn Sun Feb 26 13:44:46 2012, LeonT wrote:
Should these be merged? My brain is not functional enough right now for -- Father Chrysostomos |
From @LeontOn Mon, Feb 27, 2012 at 2:33 AM, Father Chrysostomos via RT
I don't think it should be, but the other bug should depend on this one. Leon |
Migrated from rt.perl.org#111352 (status was 'open')
Searchable as RT111352$
The text was updated successfully, but these errors were encountered: