Workbook not closing?

3 views
Skip to first unread message

furicle

unread,
Sep 2, 2009, 5:53:58 PM9/2/09
to Spreadsheet::WriteExcel
I can't seem to unmount a folder where I've created a spreadsheet.
My code does have
$workbook -> close() or die "Couldn't close workbook $!" ;
which never throws an error, and yet if I remove the spreadsheet
generating code it unmounts just fine.

Complete code is at http://paste.ubuntu.com/264054/

Remove lines 48 thru 167 and it unmounts fine...
It's not specific to sshfs. It's been like this for some time now
(years) - previous versions using Appletalk on OSX had the same
problem. I used to ignore it, but I need to get it working properly
now.

Suggestions appreciated.

Brian

jmcnamara

unread,
Sep 2, 2009, 6:44:11 PM9/2/09
to Spreadsheet::WriteExcel


On Sep 2, 10:53 pm, furicle <brian.mc...@gmail.com> wrote:
> I can't seem to unmount a folder where I've created a spreadsheet.
> My code does have
>   $workbook -> close() or die "Couldn't close workbook $!" ;
> which never throws an error, and yet if I remove the spreadsheet
> generating code it unmounts just fine.


Hi,

I have no idea what may be causing this.

To check that it is definitely related to S::WE could you replace the
code in the 48-167 foreach loop with code that copies in an existing
Excel file and remove all the WriteExcel code.

Another, unrelated guess is that you may be getting some strange
interaction between the temp files that your program creates and the
ones that S::WE creates. You could try using using WriteExcel's
set_tempdir() method to specify the same temp dir that the main
program is using. But as I said that is is a guess.

John.
--






Brian McKee

unread,
Sep 3, 2009, 1:44:55 PM9/3/09
to spreadsheet...@googlegroups.com
On Wed, Sep 2, 2009 at 6:44 PM, jmcnamara<jmcn...@cpan.org> wrote:
> On Sep 2, 10:53 pm, furicle <brian.mc...@gmail.com> wrote:
>> I can't seem to unmount a folder where I've created a spreadsheet.
>> My code does have
>>   $workbook -> close() or die "Couldn't close workbook $!" ;
>> which never throws an error, and yet if I remove the spreadsheet
>> generating code it unmounts just fine.
> To check that it is definitely related to S::WE could you replace the
> code in the 48-167 foreach loop with code that copies in an existing
> Excel file and remove all the WriteExcel code.

I removed the S::WE code and just let the 'rename' command move the
existing text file.
Unmount works fine.

> Another, unrelated guess is that you may be getting some strange
> interaction between the temp files that your program creates and the
> ones that S::WE creates. You could try using using WriteExcel's
> set_tempdir() method to specify the same temp dir that the main
> program is using. But as I said that is is a guess.

Tried $workbook -> set_tempdir('/tmp') ; No change.
Tried a few sleeps in there and a few other wild guesses. No change.

Of note, it's the **source** directory that won't unmount, the one
S::WE writes to unmounts.
Does that help us any?

Brian
--
All you need to know about Ubuntu 9.04 Jaunty -> gconftool -s --type
bool /apps/update-notifier/auto_launch false

Brian McKee

unread,
Sep 3, 2009, 1:56:04 PM9/3/09
to spreadsheet...@googlegroups.com
On Thu, Sep 3, 2009 at 1:44 PM, Brian McKee<brian...@gmail.com> wrote:
> On Wed, Sep 2, 2009 at 6:44 PM, jmcnamara<jmcn...@cpan.org> wrote:
>> On Sep 2, 10:53 pm, furicle <brian.mc...@gmail.com> wrote:
>>> I can't seem to unmount a folder where I've created a spreadsheet.
>>> My code does have
>>>   $workbook -> close() or die "Couldn't close workbook $!" ;
>>> which never throws an error, and yet if I remove the spreadsheet
>>> generating code it unmounts just fine.
>> To check that it is definitely related to S::WE could you replace the
>> code in the 48-167 foreach loop with code that copies in an existing
>> Excel file and remove all the WriteExcel code.
> I removed the S::WE code and just let the 'rename' command move the
> existing text file.
> Unmount works fine.

> Tried $workbook -> set_tempdir('/tmp') ;  No change.


> Tried a few sleeps in there and a few other wild guesses. No change.

> Of note, it's the **source** directory that won't unmount, the one
> S::WE writes to unmounts.
> Does that help us any?


I'll be durned.

Added
close (RAWREPORT) ;

after the while (<RAWREPORT>){
block
}

and it unmounts fine. I didn't think that should be required should it?

Thanks for being a sounding board.

jmcnamara

unread,
Sep 3, 2009, 6:40:04 PM9/3/09
to Spreadsheet::WriteExcel


On Sep 3, 6:56 pm, Brian McKee <brian.mc...@gmail.com> wrote:
>
> Added
>       close (RAWREPORT) ;
>
> after the while (<RAWREPORT>){
>   block
>
> }
>
> and it unmounts fine.  I didn't think that should be required should it?
>

Hi Brian,

Well done. I'm glad you sorted it out.

John.
--


Reply all
Reply to author
Forward
0 new messages