in reply to Convert KMail emails to Claws

..before the path exists ? How do I fix that please

Check the directories are being created

# replace this line # $PRETEND || -e "$newdir" || mkdir("$newdir"); # with this unless ($PRETEND || -e $newdir){ mkdir($newdir) or die "ERROR creating $newdir : Perl says $!"; }

Update ; Not sure why this is near the end of program at line 76

mkdir("$claws_tmpdir", 0755);

It should probably be up near line 64

my $MAIL_dir = "$kmaildir"; unless ($PRETEND){ mkdir($claws_tmpdir, 0755) or die "ERROR creating $claws_tmpdir : Perls says $!"; }
poj

Replies are listed 'Best First'.
Re^2: Convert KMail emails to Claws
by peterr (Scribe) on Apr 28, 2017 at 04:26 UTC

    Thanks poj. I tried that code and got an error msg "Global symbol "$newdir" requires explicit package name". I assume that must be due to the fact that the original code has "$newdir" and the replacement is $newdir

    The root of the problem is that the script is allowing the creation of a file before that path name for _that_ file has been created.That needs to have in the subroutine "process_file", yet it seems only the filename is parsed to that subroutine, not the path name as well ??