ftpput script: perl ?

Peter L. Peres plp-ysDPMY98cNQDDBjDh4tngg at public.gmane.org
Tue Apr 20 21:42:59 UTC 2004


On Tue, 20 Apr 2004, Lennart Sorensen wrote:

> On Tue, Apr 20, 2004 at 08:28:17PM +0300, Peter L. Peres wrote:
> > The tclsh program I wrote already speaks the 'dreadful ftp protocol',
> > which btw, imho, is less dreadful than other abominations, such as smtp
> > and pop3, and the point is of course to learn how it's done properly.
>
> SMTP uses a single port, speaks plain simple language that I can do over
> telnet.  Even pop3 I can do manually via telnet if I want to (sometimes
> I do).
>
> ftp has active and passive mode, binary and ascii, multiple ports, and
> other mess.  What a hassle.  Bad protocol design.

The binary is almost never needed although applications set binary before
starting transfer. The ftp protocol clearly specifies the default transfer
protocol to be 8 bit clean ascii, as in, binary (in the present sense of
the word). And binary in the sense of the ftp rfc's isn't what you'd think
at all. It dates back to 36 bit pdp and vax abominations and such. In
fact, unless you are talking to a mainframe from the previous century that
cannot help itself you probably do not want to set binary at all I think.

As to telnet, you can control a ftp session using a telnet client
connecting to port 21 on the remote machine, and netcopy. It's very easy.
telnet xxx, user, pass, pasv (this tells you the port), retr <file>, and
then netcopy the data (up or down), like nc there port </dev/null
>file.here . nc is in the netcopy package.

Peter
--
The Toronto Linux Users Group.      Meetings: http://tlug.ss.org
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml





More information about the Legacy mailing list