In Excel::Writer::XLSX::Package::Packager there is:
sub _create_package {
...
$self->_write_worksheet_files();
}
sub _write_worksheet_files {
my $self = shift;
my $dir = $self->{_package_dir};
_mkdir( $dir . '/xl' );
_mkdir( $dir . '/xl/worksheets' );
...
}
sub _mkdir {
my $dir = shift;
return if -e $dir;
my $ret = mkdir( $dir );
if ( !$ret ) {
croak "Couldn't create sub directory $dir: $!";
}
}
In Excel::Writer::XLSX::Workbook there is:
sub new {
my $class = shift;
my $self = Excel::Writer::XLSX::Package::XMLwriter->new();
...
$self->{_tempdir} = undef;
...
}
sub _store_workbook {
...
my $tempdir = File::Temp->newdir( DIR => $self->{_tempdir} );
...
$packager->_set_package_dir( $tempdir );
$packager->_create_package();
...
}
sub set_tempdir {
my $self = shift;
my $dir = shift;
croak "$dir is not a valid directory" if defined $dir and not -d $
+dir;
$self->{_tempdir} = $dir;
}
The Workbook most likely is created with an undef _tempdir (the default). It passes a $tempdir to Packager via a call to File::Temp->newdir( DIR => $self->{_tempdir} ). E.g. for me, it created drwx------. /tmp/4zsSPLpSBSM when given DIR=>undef. The tempdir created in this way is supposedly automatically deleted.
Then Workbook calls the packager with previous tempdir value as its _package_dir
Then Packager creates subdir 'xl', and then 'xl/worksheets'. _mkdir() will not complain if asked to re-create already existing dir (or file!, it checks -e)
I would set some debug messages as follows (in ..../perl5/Excel/Writer/XLSX/Package/Packager.pm):
sub _store_workbook {
...
my $tempdir = File::Temp->newdir( DIR => $self->{_tempdir} );
print "tempdir='$tempdir'\n"; # debug
if( ! -d $tempdir ){ croak "$tempdir was not created" } # debug
my $mode = (stat($tempdir))[2];
printf "Permissions are %04o\n", $mode & 07777;
...
$packager->_set_package_dir( $tempdir );
$packager->_create_package();
...
}
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.