in reply to accessing files on rmote host

To access a file on remote machine you'll have to use some kind of a protocol like HTTP, FTP, SSH ...etc

Replies are listed 'Best First'.
Re^2: accessing files on rmote host
by ikegami (Patriarch) on Mar 19, 2010 at 22:41 UTC

    True, but you seem to imply that

    /a/path/to/remote/log/file/on/machine/c

    could not map to a remote file as the OP claimed, and that's not true. All of the protocols you mentioned can be integrated into the file system. In fact, you didn't list SMB and NFS which are often if not always integrated into the file system.

    It could be that the OP just made up a path and hoped it would somehow allow him to access a remote file, in which case HTTP, SFTP, etc would prove to be potential solutions.

    But here on, I'm going to assume the path the OP is using should access a remote file. A good way to verify this is to check if it works outside of Perl, say by passing it to ls/dir. If not, then there's no reason to expect it to work in Perl. However, if it does work in the shell, you should have every expectation that it will also work in Perl.

    Some things to check:

    • Can you list that file with ls/dir?
    • Are you sure the string you are passing to open is the same you are passing to ls/dir?
    • Is the Perl script run by a different user (with different permissions) than the one as which you ran ls/dir?

    It might help to know why open failed by including $! in the error message.

      As I remember opening a file through smb requires you adding "smb:/" In front of the file name.

      I did not take the time to list all the available options I know there are more so I just finish with "...etc"

      I think the OP should have told us how he's accessing the remote file system without using scripts

        As I remember opening a file through smb requires you adding "smb:/" In front of the file name.

        Nope, that's correct just with a few I/O wrapper libraries, but not in the general case.

        Alexander

        --
        Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)