here is the output.use strict; use File::Copy; use diagnostics -verbose; my $trailer = qw( \ ); my $dev_dir = 'V:\dblomber\authdev' . $trailer; my $qa_dir = 'V:\dblomber\authqa' . $trailer; my $qa_pre_new_dir = 'V:\dblomber\auth'; my $all_qa_files; #get date yyyymmdd to append to new dir my($sec,$min,$hour,$mday,$mon,$year) = localtime; my $current_date = sprintf("%04d%02d%02d", $year+1900,$mon+1,$mday); my $qa_new_dir = $qa_pre_new_dir . $current_date . $trailer; mkdir $qa_new_dir; print "CREATED NEW ARCHIVE DIR:$qa_new_dir:\n"; opendir (QA, $qa_dir) or die "Cannot open $qa_dir $!"; print "OPENED $qa_dir\n"; opendir (QAN, $qa_new_dir) or die "Cannot open $qa_new_dir $!"; print "OPENED $qa_new_dir\n"; foreach $all_qa_files (sort readdir(QA)) { enable diagnostics; copy ("$qa_dir$all_qa_files", "$qa_new_dir$all_qa_files") or d +ie "copy Failed: $!"; print "COPYING FILE:$qa_dir$all_qa_files\t to $qa_new_dir$all_ +qa_files\n"; disable diagnostics; }
Here is the question.CREATED NEW ARCHIVE DIR:V:\dblomber\auth20060221\: OPENED V:\dblomber\authqa\ OPENED V:\dblomber\auth20060221\ Uncaught exception from user code: copy Failed: at T:\My Documents\perl\release.pl line 37. at T:\My Documents\perl\release.pl line 37
CREATED NEW ARCHIVE DIR:V:\dblomber\auth20060221\: OPENED V:\dblomber\authqa\ OPENED V:\dblomber\auth20060221\ COPYING FILE:V:\dblomber\authqa\. to V:\dblomber\auth20060221\. COPYING FILE:V:\dblomber\authqa\.. to V:\dblomber\auth20060221\. +. COPYING FILE:V:\dblomber\authqa\crap.txt to V:\dblomber\auth20 +060221\crap.txt COPYING FILE:V:\dblomber\authqa\sample.doc to V:\dblomber\auth20 +060221\sample.doc FINISHED COPYING FILES CLOSED V:\dblomber\authqa\
In reply to Yet Another File::Copy problem by djbiv
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |