Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^6: file is not getting copied

by manishrathi (Beadle)
on Jul 17, 2011 at 18:59 UTC ( [id://914990]=note: print w/replies, xml ) Need Help??


in reply to Re^5: file is not getting copied
in thread file is not getting copied

So my confusion is how to resolve this problem ? I am giving source and destination properly and files do exist in specified location. I am using copy function properly. SO why is it not working ?

Thanks

Replies are listed 'Best First'.
Re^7: file is not getting copied
by Corion (Patriarch) on Jul 17, 2011 at 19:02 UTC

    If it is not working, at least one of your assumptions is wrong. Test them one by one:

    # Test if $copy_from exists: -f $copy_from or die "File '$copy_from' does not exist"; # Test if the directory for $copy_to exists: use File::Basename; my $target_dir = dirname($copy_to); -d $target_dir or die "Target directory '$target_dir' does not exist";
Re^7: file is not getting copied
by Anonymous Monk on Jul 18, 2011 at 03:06 UTC
    #!/usr/bin/perl -- use strict; use warnings; use Path::Class; ## exists #~ my $file = q[C:\Program Files\Mozilla Firefox\chrome\icons\default\ +chatzilla-window.ico]; my $file = q[C:\Program Files\Mozilla Firefox\chrome2\icons2\default2\ +chatzilla-window2.ico]; $file = file($file); while( not -r $file ){ printf "($file):\n(%d)(%s)\n(%d)(%s)\n\n", $!,$!,$^E,$^E; $file = $file->parent; } print "$file\n\n"; __END__ (C:\Program Files\Mozilla Firefox\chrome2\icons2\default2\chatzilla-wi +ndow2.ico): (2)(No such file or directory) (3)(The system cannot find the path specified) (C:\Program Files\Mozilla Firefox\chrome2\icons2\default2): (2)(No such file or directory) (3)(The system cannot find the path specified) (C:\Program Files\Mozilla Firefox\chrome2\icons2): (2)(No such file or directory) (3)(The system cannot find the path specified) (C:\Program Files\Mozilla Firefox\chrome2): (2)(No such file or directory) (2)(The system cannot find the file specified) C:\Program Files\Mozilla Firefox

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://914990]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2024-04-26 08:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found