- print "Checking local cache: $cache\n";
- system("mkdir -p $target/");
- system("cp -f $cache/$filename $target/$filename.dl") == 0 or return;
+ if(system("test -d $cache")) {
+ print STDERR "Wrong local cache directory -$cache-.\n";
+ cleanup();
+ return;
+ }
+ if(! -d $target) {
+ system("mkdir -p $target/");
+ }
+ system("cp -vf $cache/$filename $target/$filename.dl") == 0 or return;