#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
my $fd = BackupPC::FileZIO->open($file, 0, $a->{compress});
if ( !$fd ) {
$a->{_errStr} = "Can't open $file";
my $fd = BackupPC::FileZIO->open($file, 0, $a->{compress});
if ( !$fd ) {
$a->{_errStr} = "Can't open $file";
}
(my $magic, $data) = unpack("N a*", $data);
if ( $magic != $a->{type} ) {
}
(my $magic, $data) = unpack("N a*", $data);
if ( $magic != $a->{type} ) {
my($data) = $a->writeData;
$file = $a->fileName($dir, $file);
my($data) = $a->writeData;
$file = $a->fileName($dir, $file);
- mkpath($dir, 0, 0777) if ( !-d $dir );
+ if ( !-d $dir ) {
+ eval { mkpath($dir, 0, 0777) };
+ if ( $@ ) {
+ $a->{_errStr} = "Can't create directory $dir";
+ return;
+ }
+ }
my $fd = BackupPC::FileZIO->open($file, 1, $a->{compress});
if ( !$fd ) {
$a->{_errStr} = "Can't open/write to $file";
my $fd = BackupPC::FileZIO->open($file, 1, $a->{compress});
if ( !$fd ) {
$a->{_errStr} = "Can't open/write to $file";