Hi,

An app with a ftp client & ferver builtin would do the job just grand.
RFC 959 fully descibes the mechanism, plus I'm sure you could find server
code all ready implemented in perl (a client is already available as part of
libnet).

In a nutshell you have two sockets - the protocol interpreter for commands
and the data transfer process for, well ...

Cheers,
Andy.



----- Original Message ----- 
From: "Tino Arellano" <[EMAIL PROTECTED]>
Newsgroups: perl.beginners
To: <[EMAIL PROTECTED]>
Sent: Wednesday, January 07, 2004 10:31 PM
Subject: coping txt files over a peer to peer.


> Hello folks,
>
> How do I send the file name used by the client so that the server uses the
same file name
> When it is writing it own file.
>
>
> thank you.
>
> --------------------------------here's the client:
>
> use IO::Socket;
>
> my $server = IO::Socket::INET->ne­w(
>    PeerAddr => 'localhost',
>    PeerPort => 5050,
>    Proto    => 'tcp'
> ) or die "Can't create client socket: $!";
>
>
> open FILE, "original_file_name";
>     while (<FILE>) {
>           print $server $_;
>           }
> close FILE;
>
>
> --------------------------------Here's the server:
>
> use IO::Socket;
>
> my $server = IO::Socket::INET->ne­w(
>    Listen => 5,
>    LocalAddr => 'localhost',
>    LocalPort => 5050,
>    Proto     => 'tcp'
> ) or die "Can't create server socket: $!";
>
> my $client = $server->accept;
>
>
> open FILE, ">copy_file_name" or die "Can't open: $!";
>      while (<$client>) {
>            print FILE $_;
>            }
> close FILE;
>
>
> --------------------------------------------------
>
>
>
>
>
>
> -- 
> ______________________________________________
> Check out the latest SMS services @ http://www.linuxmail.org
> This allows you to send and receive SMS through your mailbox.
>
>
> Powered by Outblaze



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to