Skip Menu |

This queue is for tickets about the Convert-BinHex CPAN distribution.

Report information
The Basics
Id: 17683
Status: resolved
Priority: 0/
Queue: Convert-BinHex

People
Owner: Nobody in particular
Requestors: SOMIAN [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 1.119
Fixed in: 1.120



Subject: test/hexbin script fails to binmode output FH
The script in test/ is not installed and not run by the automated test facilities but seems to be a valuable demonstration of the use of this library. It contains a coding error which will cause invalid output when run on a Win/DOS type system: failure to call `binmode' on the output filehandle. The output file will generally be corrupted as a result. A patch is attached: * 01_hexbin_binmode.patch I'm not perceiving that the original author (Eryq) is still doing any tasks relating to upkeep of this module (as evidenced by no new release since 1997, a year-old bug report filed here and so far not acknowledged, etc). If no action on this bug report takes place within a reasonable time, I may begin actions to adopt this apparently orphaned module. Sören Andersen
Subject: 01_hexbin_binmode.patch
*** /tmp/local/build/.cpan/build/Convert-BinHex-1.119/test/hexbin Sun Mar 23 12:58:37 1997 --- /usr/local/build/.cpan/build/Convert-BinHex-1.119/test/hexbin Thu Feb 16 15:28:11 2006 *************** *** 41,50 **** --- 41,51 ---- # Output data fork: $fname = "$dir/$name"; print STDERR "Writing $fname (data fork)\n"; printf STDERR "Expecting: %6d bytes\n", $HQX->data_length if $opt_v; open DATA, ">$fname" or die "open $fname: $!"; + binmode DATA; while ($bytes = $HQX->read_data) { print DATA $bytes; } close DATA; printf STDERR "Wrote: %6d bytes\n", (-s $fname) if $opt_v;
On Thu Feb 16 15:58:12 2006, SOMIAN wrote: Show quoted text
> The script in test/ is not installed and not run by the automated
test Show quoted text
> facilities but seems to be a valuable demonstration of the use of
this Show quoted text
> library. It contains a coding error which will cause invalid output > when run on a Win/DOS type system: failure to call `binmode' on the > output filehandle. The output file will generally be corrupted as a > result. A patch is attached: > > * 01_hexbin_binmode.patch
The patchfile didn't also do binmode on the RESOURCE filehandle, trying now to upload a new version of this patch.
*** /tmp/local/build/.cpan/build/Convert-BinHex-1.119/test/hexbin Sun Mar 23 12:58:37 1997 --- /usr/local/build/.cpan/build/Convert-BinHex-1.119/test/hexbin Thu Feb 16 16:00:56 2006 *************** *** 41,50 **** --- 41,51 ---- # Output data fork: $fname = "$dir/$name"; print STDERR "Writing $fname (data fork)\n"; printf STDERR "Expecting: %6d bytes\n", $HQX->data_length if $opt_v; open DATA, ">$fname" or die "open $fname: $!"; + binmode DATA; while ($bytes = $HQX->read_data) { print DATA $bytes; } close DATA; printf STDERR "Wrote: %6d bytes\n", (-s $fname) if $opt_v; *************** *** 52,61 **** --- 53,63 ---- # Output resource fork: $fname = "$dir/$name.rsrc"; print STDERR "Writing $fname (resource fork)\n"; printf STDERR "Expecting: %6d bytes\n", $HQX->resource_length if $opt_v; open RESOURCE, ">$fname" or die "open $fname: $!"; + binmode RESOURCE; while ($bytes = $HQX->read_resource) { print RESOURCE $bytes; } close RESOURCE; printf STDERR "Wrote: %6d bytes\n", (-s $fname) if $opt_v;
On Thu Feb 16 16:09:53 2006, SOMIAN wrote: Show quoted text
> The patchfile didn't also do binmode on the RESOURCE filehandle,
trying Show quoted text
> now to upload a new version of this patch.
And THIRD TIME IS THE CHARM, it is to be hoped. Goofy user error on Cygwin resulted in an erronious patchfile with absolute paths in it (starting with "/"). Fixed in this one.
*** tmp/local/build/.cpan/build/Convert-BinHex-1.119/test/hexbin Sun Mar 23 12:58:37 1997 --- usr/local/build/.cpan/build/Convert-BinHex-1.119/test/hexbin Thu Feb 16 16:00:56 2006 *************** *** 41,50 **** --- 41,51 ---- # Output data fork: $fname = "$dir/$name"; print STDERR "Writing $fname (data fork)\n"; printf STDERR "Expecting: %6d bytes\n", $HQX->data_length if $opt_v; open DATA, ">$fname" or die "open $fname: $!"; + binmode DATA; while ($bytes = $HQX->read_data) { print DATA $bytes; } close DATA; printf STDERR "Wrote: %6d bytes\n", (-s $fname) if $opt_v; *************** *** 52,61 **** --- 53,63 ---- # Output resource fork: $fname = "$dir/$name.rsrc"; print STDERR "Writing $fname (resource fork)\n"; printf STDERR "Expecting: %6d bytes\n", $HQX->resource_length if $opt_v; open RESOURCE, ">$fname" or die "open $fname: $!"; + binmode RESOURCE; while ($bytes = $HQX->read_resource) { print RESOURCE $bytes; } close RESOURCE; printf STDERR "Wrote: %6d bytes\n", (-s $fname) if $opt_v;
CC: SOMIAN [...] cpan.org
Subject: Re: [rt.cpan.org #17683] test/hexbin script fails to binmode output FH
Date: Mon, 20 Feb 2006 11:39:18 -0500
To: bug-Convert-BinHex [...] rt.cpan.org
From: Eryq <eryq [...] zeegee.com>
That's correct; I'm not able to work on this module. If Soren would like to take it, I hereby cede ownership. Eryq
I've applied Soren's patch in my repository: https://github.com/stephenenelson/convert-binhex I'd be happy to take on maintainer or co-maintainer status on this module. On Mon Feb 20 11:39:58 2006, eryq@zeegee.com wrote: Show quoted text
> That's correct; I'm not able to work on this module. If Soren would > like to take it, I hereby cede ownership. > > Eryq
Released. On Wed Aug 21 02:51:54 2013, STEPHEN wrote: Show quoted text
> I've applied Soren's patch in my repository: > > https://github.com/stephenenelson/convert-binhex > > I'd be happy to take on maintainer or co-maintainer status on this module. > > On Mon Feb 20 11:39:58 2006, eryq@zeegee.com wrote:
> > That's correct; I'm not able to work on this module. If Soren would > > like to take it, I hereby cede ownership. > > > > Eryq
>