forum.vmspython.org Forum Index forum.vmspython.org
Forum system
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

FTP and Carriage Return

 
Post new topic   Reply to topic    forum.vmspython.org Forum Index -> Python for OpenVMS
View previous topic :: View next topic  
Author Message
MChipping



Joined: 20 Jul 2013
Posts: 1

PostPosted: Sat Jul 20, 2013 12:17 am    Post subject: FTP and Carriage Return Reply with quote

Hi,
I am attempting to use Python's FTPLIB to FTP a file from OpenVMS to a Windows machine. The FTPd file on the Windows machine looses the carriage return between data rows.
If there a way to preserve the file format? (The code works as expected when FTP(ing) the file between two Windows machines).

[code]
ftp = ftplib.FTP()
ftp.connect('theFTPServerIP')
ftp.login('FTPID', 'FTPPassword')
ftp.set_pasv(True)
ftp.cwd('\\Server\\Path\\')
ftp.storlines('STOR ' + File1.txt, open(MyFile.txt, 'r'))
ftp.quit
[/code]

Thanks
Back to top
View user's profile Send private message
jescab



Joined: 28 Jan 2008
Posts: 254

PostPosted: Sat Jul 20, 2013 11:35 am    Post subject: Reply with quote

Have you tried to read the file in a for loop and send each line with putline() instead?
What does the file on Windows actualy has for "end of line"? A LF maybe ?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forum.vmspython.org Forum Index -> Python for OpenVMS All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group