
scooper
Deleted
Jan 16, 2001, 9:44 AM
Post #1 of 1
(220 views)
|
|
trouble copying a file?!
|
Can't Post
|
|
can anybody suggest a better way to do this:
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 !
|