CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate:
trouble copying a file?!

 



scooper
Deleted

Jan 16, 2001, 9:44 AM

Post #1 of 1 (294 views)
trouble copying a file?! Can't Post

can anybody suggest a better way to do this:


Code
sub create_index { 
# if ($verbose_mode) {my $message = "updating master index in $current_dir\n"; write_log($message)}
my @copy_this = ("cp", "$masterindex_file", "$current_dir");
system(@copy_this) == 0 or die "system @copy_this fails again $?\n";

}

For whatever reason my script complains that the copy failed because the target directory
doesn't exist. The target directory is definitely there.

I've tried 'sleeping' the script to give the target directory time to be built, but this doesn't help at all.

I've also tried creating the directory BEFORE running the script.

If I rerun the script everything is OK! the file get's copied to the target as expected.

also if you can explain what's broken ....

This really has me baffled !


 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives