problem when getting ftp file

Francis Lavoie franz04 at yahoo.fr
Tue Aug 17 17:32:32 CEST 2004


I'm new to python and I'm not sure if I use the ftplib
class correctly.

I made a programm to update a pseudo-dynamic site via
ftp. The site is a static html that include files
update by ftp. It create 2 files, and html and a .dat
file, which hold a easier to manipulate data.

first of all, when I start the application, it connect
to ftp, and get the .dat files on the ftp server to
stay up to date. Then modification are done to the
local file, when the application receive a update
request, it take the local file and update it to the
server.

The update work perfectly, but the part I get the file
from ftp cause me some trouble. The client app is run
on windows. To create the file and to read it, I use
open("myfile.dat").write and readlines, there's no
problem, but when I get a new file from ftp, the
return line disapear and readlines take the all the
file as one line.

To write the new file in ftp I use :
storlines("STOR", open("myfile.dat").read)
And to get it I use :
retrlines("RETR", open("myfile.dat").write)


If someone can guide me where to look to find a
solution, it will be appreciated.

Thank you


__________________________________________________________
Lèche-vitrine ou lèche-écran ?
magasinage.yahoo.ca



More information about the Python-list mailing list