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

Does anybody here have any suggestions on Modules that pertain to network file transfers? I am trying to write my own transport mechanism? I wish to avoid things like FTP and HTTP, and it has to be cross platform. If there aren't any modules can somebody offer some suggestions on how. Thanks!

Replies are listed 'Best First'.
Re: Network File transfer
by Anonymous Monk on Feb 06, 2000 at 05:40 UTC
    Try looking at the source for Net::TFTP. That should provide a good start for the transfer protocol iself. I agree that reverse DNS lookups and some sort of authentication is required. Take a look at the PAM modules on CPAN for a good portable way to implement this. You can also use the Net::SSL module for connection privacy.
RE: Network File transfer
by IndyZ (Friar) on Feb 04, 2000 at 03:39 UTC
    I don't know of any modules of hand. The easiest (and least secure) way to do this is have your recieving program listen on a TCP port. Have your sending program connect, send the filename to saves as followed by a newline. The recieving program takes this filename and opens it for writing. Then, the sending program starts sending data, and the recieving program writes it to a file. The sender just drops the connection when the file is completed. You would probably have to have the reciever check ip addresses or you could add usernames/passwords in addition to the filename headers. I will try to post example code later today. Remember, this is TOTALLY insecure without passwords, or at least ip checks.