Skip Menu |

This queue is for tickets about the File-Binary CPAN distribution.

Report information
The Basics
Id: 29472
Status: resolved
Priority: 0/
Queue: File-Binary

People
Owner: Nobody in particular
Requestors: peter.moller [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: missing binmode?
Date: Tue, 18 Sep 2007 20:01:53 +0200
To: bug-File-Binary [...] rt.cpan.org
From: "Peter Möller" <peter.moller [...] gmail.com>
Using File::Binary on winXP and Activestates Perl Error - example when doing put_bytes($output . $c); and $c happens to be a "\n". what gets written to file is $output . "\r\n" Fix do a binmode($fh) after $fh is creted in open. ----------------------- sub open { my ($self, $file) = @_; my $fh; my $writeable = -1; if (ref($file) =~ /^IO::/ && $file->isa('IO::Handle')) { $fh = $file; $writeable = 2; # read and write mode } else { $fh = IO::File->new($file) || die "No such file $file\n"; if ($file =~ /^>/) { $writeable = 1; } elsif ($file =~ /^\+>/) { $writeable=2; } binmode($fh); ## <<<<<<<<<<<<<<<<<<<<<<<<<<<< } -- sigsigsigsigsagsigsigsigsig
Fixed in 1.5 - I can't believe I didn't notice this bug and release a fix sooner. Thanks, Simon