[Tutor] FTP: Binary vs. Text Mode

Magnus Lycka magnus@thinkware.se
Wed Feb 5 05:14:02 2003


At 10:58 2003-02-05 +0100, Tom Churm wrote:
>what's the worst that can happen when a text file is uploaded in binary mode?

This has nothing to do with Python really, but the
issue is that different operating systems have
different standards for line endings.

DOS and derivates use a carriage return (ASCII value 13)
followed by a line feed (ASCII value 10). Unix uses only
line feed, and Mac uses only carriage return.

Text mode FTP transfer translates this. Binary mode don't.

So, the consequences depend on what combinations of
operating systems you use on servers and clients. If
you consistently use binary mode for both download and
upload, and only use one OS family on the clients, you
won't notice a thing.


-- 
Magnus Lycka, Thinkware AB
Alvans vag 99, SE-907 50 UMEA, SWEDEN
phone: int+46 70 582 80 65, fax: int+46 70 612 80 65
http://www.thinkware.se/  mailto:magnus@thinkware.se