Skip Menu |

This queue is for tickets about the GDS2 CPAN distribution.

Report information
The Basics
Id: 51629
Status: resolved
Priority: 0/
Queue: GDS2

People
Owner: Schumack [...] cpan.org
Requestors: daniel.risler [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 2.09
Fixed in:
  • 3.00
  • 3.27
  • 3.28
  • 3.29



experimental feature close(-pad=2048); is not working for me; e.g.: $gds2File->close(-pad=>2048); but the output file is not a multiple of 2048. The value returned by $gds2File->tellSize is not correct; so somewhere the output file is not accumulating the correct byte offset?. Here is a suggestion to use "seek" on the open file, to get the byte offset, instead of keeping track of it yourself: sub close { ... ... if ((defined $pad)&&($pad > 0)) { my $fh = $self -> {'FileHandle'}; seek $fh,0,2; # seek to EOF my $fileSize = tell($fh); # my $fileSize = $self -> tellSize ## this is not working! .... .... Padding the file to 2048 is good because some of the CAD tools give warning messages. I would go as far as having this be the default behavior.
Subject: Re: [rt.cpan.org #51629]
Date: Tue, 17 Nov 2009 21:06:51 -0600
To: bug-GDS2 [...] rt.cpan.org
From: Ken Schumack <kenschumack [...] gmail.com>
Hi Daniel, thanks for the feedback. On Tue, Nov 17, 2009 at 17:39, Daniel Risler via RT <bug-GDS2@rt.cpan.org>wrote: Show quoted text
> Tue Nov 17 18:39:47 2009: Request 51629 was acted upon. > Transaction: Ticket created by drisler > Queue: GDS2 > Subject: (No subject given) > Broken in: 2.09 > Severity: Important > Owner: Nobody > Requestors: daniel.risler@gmail.com > Status: new > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=51629 > > > > experimental feature close(-pad=2048); is not working for me; > e.g.: > > $gds2File->close(-pad=>2048); > > but the output file is not a multiple of 2048. The value returned by > > $gds2File->tellSize is not correct; so somewhere the output file is not > accumulating the correct byte offset?. Here is a suggestion to > use "seek" on the open file, to get the byte offset, instead of keeping > track of it yourself: > > sub close > { > ... > ... > if ((defined $pad)&&($pad > 0)) > { > my $fh = $self -> {'FileHandle'}; > > seek $fh,0,2; # seek to EOF > my $fileSize = tell($fh); > > # my $fileSize = $self -> tellSize ## this is not working! > > .... > .... > > Padding the file to 2048 is good because some of the CAD tools give > warning messages. I would go as far as having this be the default > behavior. >
-- Nothing would be green without CO2
Doing cleanup. Resolved in the Valentine's day 2010 3.00 release.