in reply to Convert KMail emails to Claws
Is this simply because the file is attempted to be copied before the path exists ? How do I fix that please
That could very well be.
use File::Basename; use File::Path; ... my $nfile = ''; ... if (-e "$file" && $nfile ne "") { my $dir = dirname $nfile; if( !-d $dir ) { make_path($dir) or die "Can't create $dir: $!\n"; } $DEBUG && print qq{\n+++ cp "$file" "$nfile"}; $PRETEND || system("cp \"$file\" \"$nfile\""); $count++; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Convert KMail emails to Claws
by peterr (Scribe) on Apr 28, 2017 at 04:19 UTC | |
by huck (Prior) on Apr 28, 2017 at 04:32 UTC |