Gossamer Forum
Home : General : Perl Programming :

copying a directory and subdirectories

Quote Reply
copying a directory and subdirectories
trying to write a subroutine to copy all the files in a directory, as well as the subdirectories and their files

Code:

use File::Copy::Recursive qw(dircopy );

my ($new_date) = &date_to_unix(&get_date);

my $newdirname = $new_date;
if ((-e "$backup_dir/$newdirname")) {
&html_admin_home("backup already exists for this date");
}
else {

my $src = "$db_data_path";
my $dest = "$backup_dir/$newdirname";

dircopy($src, $dest) or die "Can't dircopy: $db_data_path $!";
}


getting following error although ...data is the directory i want to copy
Can't dircopy: /var/home/delicia/delicia.com/cgi-bin/public/data No such file or directory

Last edited by:

delicia: May 21, 2018, 7:53 AM
Subject Author Views Date
Thread; hot thread copying a directory and subdirectories delicia 13442 May 21, 2018, 7:50 AM
Thread; hot thread Re: [delicia] copying a directory and subdirectories
Andy 13296 May 22, 2018, 5:55 AM
Thread; hot thread Re: [Andy] copying a directory and subdirectories
delicia 13291 May 22, 2018, 10:58 AM
Thread; hot thread Re: [delicia] copying a directory and subdirectories
Andy 13290 May 22, 2018, 10:45 PM
Thread; hot thread Re: [Andy] copying a directory and subdirectories
delicia 13281 May 23, 2018, 6:18 AM
Thread; hot thread Re: [delicia] copying a directory and subdirectories
Andy 13282 May 23, 2018, 6:18 AM
Thread; hot thread Re: [Andy] copying a directory and subdirectories
delicia 13278 May 23, 2018, 6:47 AM
Thread; hot thread Re: [delicia] copying a directory and subdirectories
Andy 13280 May 23, 2018, 6:51 AM
Thread; hot thread Re: [Andy] copying a directory and subdirectories
delicia 13273 May 23, 2018, 7:17 AM
Thread; hot thread Re: [delicia] copying a directory and subdirectories
Andy 13269 May 23, 2018, 7:25 AM
Thread; hot thread Re: [Andy] copying a directory and subdirectories
delicia 13268 May 23, 2018, 7:44 AM
Thread; hot thread Re: [delicia] copying a directory and subdirectories
Andy 13258 May 23, 2018, 8:03 AM
Thread; hot thread Re: [Andy] copying a directory and subdirectories
delicia 13260 May 23, 2018, 8:04 AM
Post; hot thread Re: [delicia] copying a directory and subdirectories
Andy 13256 May 23, 2018, 8:04 AM