in reply to Re: Remove Script for a Infrastructure file managenet system running embedded perl
in thread Remove Script for a Infrastructure file managenet system running embedded perl

Hi roboticus,

Escaping the backslashes aren't exactly helpful. The error i get is,

Can't stat \\hostname\share-test: No such file or directory at testArchive.pl line 30

Can't stat \\hostname\share-test: No such file or directory at testArchive.pl line 42

This is probably because the script is running from a different server node than the share directories it is trying to stat("\\hostname\share-test"). A test with remote windows shares reachable by "\\{nodename}" came out with this error. Perhaps rmdir is won't connect the share directory from a given path such a way. Thanks for the quick response though.

  • Comment on Re^2: Remove Script for a Infrastructure file managenet system running embedded perl

Replies are listed 'Best First'.
Re^3: Remove Script for a Infrastructure file managenet system running embedded perl
by roboticus (Chancellor) on Jul 18, 2010 at 12:12 UTC

    sanju7:

    I find the first error message surprising, as I'd expect that the line numbers reported would be lines where the code would actually try to access the files, rather than for calling File::Find's find function. I notice that you've got a prototype on your filter function, so I'd drop the parenthesis. I don't know perl well enough to know if it would/could cause that problem or not, but it's certainly not helpful.

    ...roboticus

      Dropping the parenthesis doesn't change anything. I am still not getting if the script didn't understand the path belongs to a remote share and trying to stat it locally causing the error ..?

        sanju7:

        You may want to re-read the documentation for File::Find's wanted function. You're using the $_ variable, which doesn't contain the full path name to the file(s) of interest (unless you've set the no_chdir option). So at the very least, you need to set the no_chdir flag or your subroutines would need to change.

        Other things I can think of to check:

        Is the script running under your user account, or some other account? If it's another account, perhaps that account doesn't have access to the share(s) on the other boxes.

        To test your question about whether the script understands a remote path: Check it without the rest of your program, so you can clearly determine whether or not it understands the remote path, something like:

        perl -e 'print "exists" if -e "//hostname/share-test"'

        ...roboticus