in reply to file::find problems accessing files on a network

Read File::Find again. $_ only holds the file name (as in basename $path) - you want

copy($File::Find::name, $new_location) or warn "$!" ;

Replies are listed 'Best First'.
Re^2: file::find problems accessing files on a network
by smanicka (Scribe) on Jan 05, 2009 at 16:23 UTC
    Thanks to your post.I tried changing that.Still no files are being copied.It won't even print out the file names using that print statement in force_move function when I try for network files

      I wonder why you get the file names printed out using

      print "copying $File::Find::file from $File::Find::dir\n";

      since there's no variable $File::Find::file in File::Find - at least in my version (1.10). What version do you have (print $File::Find::VERSION) ?

      What happens if you change

      my @location=("\\\\network1\\pics","\\\\network1\\fonts","\\\\network1 +\\forms");

      to

      my @location = ("//network1/pics", "//network1/fonts", "//network1/for +ms");

      - does $File::Find::name hold the full path, then?

        It works now. I have no clue what changed the behavior.And it didnt work when i had $file::Find::file .I instead just used $file that is assigned t the current value of $_. I used just the mapped network drive in the path.

        thanks

        Sandhya