niewczyk has asked for the wisdom of the Perl Monks concerning the following question:
Dear Fellow Monks,
I've been racking my trying to figure out why the dircopy function of File::Copy::Recursive behaves in the following way with the below code:
#!/usr/bin/perl use strict; use File::Copy; use File::Copy::Recursive qw ( dircopy ); my $machine = Win32::NodeName; my $shop = substr($machine,0,4); my $snum = substr($machine,5); my $BOX1 = $shop . "1" . $snum; my $BOX2 = $shop . "2" . $snum; print " ###################\n"; print " # COPYING TIREPIX #\n"; print " ###################\n"; my $box1_tirepix_dir = "\\\\$BOX1\\e\\dbmonro\\tirepics"; my $box2_tirepix_dir = "\\\\$BOX2\\e\\dbmonro\\tirepics"; print "Copying from $box1_tirepix_dir to $box2_tirepix_dir\n"; print "Removing $box2_tirepix_dir\n"; system("rmdir /S /Q $box2_tirepix_dir") or print localtime()." in syst +em TIREPIX rmdir: $!\n"; sleep(10); print "creating directory $box2_tirepix_dir\n"; mkdir($box2_tirepix_dir) or print " in TIREPIX mkdir: $!\n"; dircopy($box1_tirepix_dir,$box2_tirepix_dir) || print " TIREPIX dircop +y: $!\n";
RESULTS:
NOTES:
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: File::Copy::Recursive dircopy side effect (File::Spec)
by tye (Sage) on Feb 12, 2014 at 15:09 UTC | |
by niewczyk (Initiate) on Feb 17, 2014 at 16:19 UTC | |
by tye (Sage) on Feb 18, 2014 at 07:42 UTC |