s_gaurav1091 has asked for the wisdom of the Perl Monks concerning the following question:

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
Re: existence of a file on remote host
by blazar (Canon) on Sep 01, 2005 at 14:16 UTC
Re: existence of a file on remote host
by InfiniteSilence (Curate) on Sep 01, 2005 at 14:11 UTC
    Well that sort of depends on several things:
  • Is this remote host in your local network?
  • Do you have permissions to look for files on that remote host?
  • What kind of host OS (Windows|Linux|Other)? ???

    Celebrate Intellectual Diversity

      You can say that again!

      Jack

Re: existence of a file on remote host
by Fletch (Bishop) on Sep 01, 2005 at 14:09 UTC

    Well, see the problem with the code you've posted is that it's nonexistent. Written code has a much better chance of not working (or even working) than that which hasn't been.

    (Perhaps if you posted what you've tried . . .)

    --
    We're looking for people in ATL

Re: existence of a file on remote host
by ChrisR (Hermit) on Sep 01, 2005 at 14:10 UTC
    perldoc perlvms</code>
    File tests The tests "-b", "-B", "-c", "-C", "-d", "-e", "-f", "-o", "-M", "-s", "-S", "-t", "-T", and "-z" work as advertised. The return values for "-r", "-w", and "-x" tell you whether you can actually access the file; this may not reflect the UIC-based file protec- tions. Since real and effective UIC don't differ under VMS, "-O", "-R", "-W", and "-X" are equivalent to "-o", "-r", "-w", and "-x". Similarly, several other tests, including "-A", "-g", "-k", "-l", "-p", and "-u", aren't particularly meaningful under VMS, and the values returned by these tests reflect whatever your CRTL "stat()" routine does to the equivalent bits in the st_mode field. Finally, "-d" returns true if passed a device specification without an explicit directory (e.g. "DUA1:"), as well as if passed a direc- tory. Note: Some sites have reported problems when using the file-access tests ("-r", "-w", and "-x") on files accessed via DEC's DFS. Specifically, since DFS does not currently provide access to the extended file header of files on remote volumes, attempts to exam- ine the ACL fail, and the file tests will return false, with $! indicating that the file does not exist. You can use "stat" on these files, since that checks UIC-based protection only, and then manually check the appropriate bits, as defined by your C com- piler's stat.h, in the mode value it returns, if you need an approximation of the file's protections.
    update: Never mind