in reply to File name is long to copy
I got:use strict; use warnings; use File::Copy; my $source="C:\\sandboxes\\source_backup\\source_backup\\source_develo +p\\source_folder\\source_part\\source_specific\\source_common\\rb_src +c_sourcedevelopfolderpartspe_Interfacessourcecommonspecific.h"; my $target="C:\\sandboxes\\target_backup\\target_backup\\target_develo +p\\generated\\_hnv_scan\\_source_develop\\source_folder\\source_part\ +\source_specific\\source_common"; print "OK 1\n" if -e $source; print "OK 2\n" if -d $target; copy($source,$target) or die "could not do: $!"; print ("done");
However, the first time I ran it, it failed because I had not named the $target directories correctly.C:\_32\pscrpt>perl try.pl OK 1 OK 2 done C:\_32\pscrpt>
Please do check that both the $target directory and $source file do actually exist, as it seems to me that the most likely explanation of your issue is a typographical error.C:\_32\pscrpt>perl try.pl OK 1 could not do: at try.pl line 10.
|
|---|