newbie : ftp auto-uncompress?

Sandipan Gangopadhyay sandipan at vsnl.com
Sat May 19 05:13:12 CEST 2001


AFAIK, the server did it. Your ftp object received uncompressed text.

HTH,

Sandipan
----- Original Message -----
From: "Buster Brown" <buster2642 at MailAndNews.com>
Newsgroups: comp.lang.python
To: <python-list at python.org>
Sent: Saturday, May 19, 2001 7:56 AM
Subject: newbie : ftp auto-uncompress?


> I created a simple ftp download script (run on Linux) :
>
> from ftplib import FTP
> File = open('fileName', 'w')
> ftp=FTP('this.that.nasa.gov')
> ftp.login()
> ftp.cwd('/go/to/new/sub/directory/')
> ftp.retrbinary('RETR ' + 'fileName', File.write, 1024)
> ftp.quit()
> File.close
>
> The script did what I wanted.  However, at the download site the filename
is
> actually 'fileName.Z'.  The file saved in my local directory is
uncompressed
> to text, as I want.  What function did the Unix 'uncompress', File.write?
> Is it due to my choice of 'fileName' and not 'fileName.Z' in the 2 lines?
>
> I searched the Python documentation with no luck.  Any pointers/links to
> documentation about this much appreciated.
>
> Chuck
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>





More information about the Python-list mailing list