Hi Siegfried,

On Sunday 10 Apr 2011 21:55:30 siegfr...@heintze.com wrote:
> I want to implement a implement a poor man's ftp server that has minimal
> dependencies (like none!). I'll write a simple custom poor man's ftp
> client on the other side. Since I'm writing both the client and the
> server, I don't need to worry about adherence to the ftp standard --
> only the concept.
> 
> So how can I write a simple perl program that waits on a TCP socket for
> a file name followed by the file contents (I don't need to worry the
> path names -- everything goes in the same directory).
> 
> Can I assume that an entire perl source code file will fit in a single
> socket packet? I've only used print statements before. I could write a
> single record per the call to the socket send function. Is there a
> better way? (I hope so!)
> 
> Recommendations are welcome!

Please look at http://cpan.uwinnipeg.ca/dist/POE-Component-Server-FTP or a 
similar module for one of newer event-based systems, such as IO::Async, 
AnyEvent, IO::Lambda or Reflex . These allow you to easily code a custom FTP 
server or client.

Regards,

        Shlomi Fish

-- 
-----------------------------------------------------------------
Shlomi Fish       http://www.shlomifish.org/
Chuck Norris/etc. Facts - http://www.shlomifish.org/humour/bits/facts/

The difference between a good student and a bad student is that a bad student
forgets the material five minutes before the test, while a good student five
minutes afterwards.
    -- One of Shlomi Fish's Technion Lecturer

Please reply to list if it's a mailing list post - http://shlom.in/reply .

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to