Re: What is wrong with this file copy script

2006-03-12 Thread JupiterHost.Net
Hello Harry, hpdb cp'ing ./dir1/2765 => ./tmp/001 Failed to copy ./dir1/2765 => ./tmp/001: No such file or directory at ./renum2.pl line 111 I didn't want to read the entire script (a triffle busy ;p) but perhaps File::Copy::Recursive (IE dircopy()) will help. Then if the file na

Re: What is wrong with this file copy script

2006-03-12 Thread Shawn Corey
Harry Putnam wrote: #!/usr/local/bin/perl -w @directories = ("./dir1", "./dir2"); for(@directories) { opendir(WRK_DIR,"$_"); opendir(WRK_DIR,$_) or die "cannot opendir $_: $!\n"; chdir $_; chdir $_ or die "cannot chdir $_: $!\n"; # This fails for the second directory since it chdir to

Re: What is wrong with this file copy script

2006-03-12 Thread Shawn Corey
Harry Putnam wrote: That formula did'nt do it either but it did show a different error that throws some light on this. Notice the first file is the directory name hpdb cp'ing ./dir1 => tmp/001 Failed to copy ./dir1 => tmp/001: Is a directory at ./renum2.pl line 113 Thats why copy i

Re: What is wrong with this file copy script

2006-03-12 Thread Harry Putnam
Shawn Corey <[EMAIL PROTECTED]> writes: > When File::Find goes looking for files, it chdir's to each directory > its looking in. When it's in ./dir1, there is no ./dir1/tmp to copy > files into, so you get an error. Change your calling sequence of > find() to: > > find( { wanted => \&wanted, no_

Re: What is wrong with this file copy script

2006-03-12 Thread Harry Putnam
Shawn Corey <[EMAIL PROTECTED]> writes: > When File::Find goes looking for files, it chdir's to each directory > its looking in. When it's in ./dir1, there is no ./dir1/tmp to copy > files into, so you get an error. Change your calling sequence of > find() to: > > find( { wanted => \&wanted, no_

Re: What is wrong with this file copy script

2006-03-12 Thread Harry Putnam
> I'm already bald so don't have the luxury of pulling hair over this. [...] > $new = $tmpdir."/".$new; > $oldf = $File::Find::name; > print "hpdb cp\'ing $oldf => $new\n"; > copy($oldf, $new) > or die "Failed to copy $oldf => $new: $!"; > } I figured out the sour

Re: What is wrong with this file copy script

2006-03-12 Thread Shawn Corey
Harry Putnam wrote: I'm already bald so don't have the luxury of pulling hair over this. I don't understand the error ouput or maybe I could get somewhere with this. Pouring over perldoc File::Copy isn't helping either... I think the error is before that but can't see what. The end result of

What is wrong with this file copy script

2006-03-12 Thread Harry Putnam
I'm already bald so don't have the luxury of pulling hair over this. I don't understand the error ouput or maybe I could get somewhere with this. Pouring over perldoc File::Copy isn't helping either... I think the error is before that but can't see what. The end result of this script is suppos