in reply to How can I access a file on a remote server?

As I understand it, you want to run a script on your workstation, that opens the file on the server and reads/writes it...

Your available options are determined by the ways the server allows you to connect. The only method I've seen you mention in the thread is by using Telnet, which is definitely not the way to go... Though you could have your client script login thru telnet and have it start another (server)script that allows the two to communicate...

I recall reading a chapter on RPC (Remote Procedure Call) in O'Reilly's Advanced Perl Programming Book. This method would require you to run a 'homemade' server-script on the server which would allow a client-script to perform any perl command transparantly on the server.

CPAN's RPC::Simple seems to provide something like this.

I think the way to go for you though is asking your sysadmin to allow access using NFS or Samba if you're using a windows workstation...

Replies are listed 'Best First'.
Re: Re: How does perl's file I/O work?
by Anonymous Monk on Jan 21, 2003 at 15:17 UTC
    I will check it out, thanks a lot. Is there any reason why telnet is not a suitable solution? Because I find that Net::Telnet might just do the job, I don't know how to use it yet but it seems like it allows me to make client connections to a TCP port and do network I/O, especially to a port using the TELNET protocol. I don't know if it provides any I/O methods but like, so far I have these code at least these will work for connecting: use Net::Telnet (); $t = new Net::Telnet (Timeout => 10, Prompt => '/ksh\$ $/'); $t->open($host); $t->login($username, $passwd); is this correct? What to do after taht I don't know, hopefully I can find out by doing more research, but this seems like it owuld do the job, what do you think? Kelvin
Re: Re: How does perl's file I/O work?
by Anonymous Monk on Jan 21, 2003 at 15:19 UTC
    I will check it out, thanks a lot. Is there any reason why telnet is not a suitable solution? Because I find that Net::Telnet might just do the job, I don't know how to use it yet but it seems like it allows me to make client connections to a TCP port and do network I/O, especially to a port using the TELNET protocol. I don't know if it provides any I/O methods but like, so far I have these code at least these will work for connecting:
    use Net::Telnet (); $t = new Net::Telnet (Timeout => 10, Prompt => '/ksh\$ $/'); $t->open($host); $t->login($username, $passwd);
    is this correct? What to do after taht I don't know, hopefully I can find out by doing more research, but this seems like it owuld do the job, what do you think? Kelvin
      Problem is that after establishing the telnet session, the other side of the connection is just a login shell waiting for input. You could use that shell to dump the file and store the input locally, but there is a problem.

      System messages can be sent to a terminal session by the server, which would then show up in the middle of your file. I'm talking about things like 'You have new mail' or 'System will go down for maintenance' and the such.

      If your workstation is a Unix machine, I would suggest buying your sysadmin a pizza and asking him to allow you to connect to your homedir using nfs. If it's a windows machine, do the same after installing an nfs-client for Windows.

      NFS allows you to 'mount' the filesystem on your local machine, making it 'look' local to all your applications. After doing that you could access the file in any way you would want...