Knowledge Base

Enter search queries below or use the tag links to the right to browse the knowledge base by category (Show All Tags).


How do Robo-FTP and Robo-FTP Server handle the difference in line endings between systems?

The ASCII standard for text does not specify a line ending character (also known as end-of-line or EOL). As a result, makers of systems adopted their own conventions. Windows (DOS), Unix, and Mac use CR-LF, LF, and CR to terminate lines, respectively. As of the release of Mac OS X, Macs use LF. There are even some systems that use LF-CR, although those are pretty uncommon these days.

This caused serious problems once people wanted to network systems from different manufacturers together. Therefore, during this time (back in the early 1970s) ARPAnet researchers agreed on a convention:

All text files sent across the network must have lines terminated with CR-LF.

This means Windows-based FTP clients and servers do not have to do any type of conversion when uploading / downloading files. On Windows, files already have the CR-LF line endings required for FTP.

Keep in mind that this only applies to files sent / received using SFTP, HTTP, and FTP in ASCII mode. Files transferred with FTP in binary mode go through no conversion. Therefore, if you download a text file from a Unix server using binary mode, the file will still have Unix line endings.

All files transferred with the SFTP, FTP, and HTTP protocols are sent in binary mode unless (1) the /type=ASCII option is specified for the SENDFILE or RCVFILE commands or (2) the connection is made by passing the name of a Managed Site record to the FTPLOGON command that specifies an alternate transfer mode. When using the option to send in ASCII mode, CR-LF pairs are converted to LF. Therefore you should only use this option when sending to a server that expects files to have this type of line ending (such as Unix servers).

Previous to version 3.10, Robo-FTP did not support ASCII mode for sending/receiving files with SFTP. In these older versions, no line ending conversion is done. If you require this conversion, you can do so using a utility that performs the conversion before or after sending.

You can do this using the freely available unix2dos and dos2unix utilities.

Robo-FTP Server does not perform any line ending conversion. It is expected that the client software that is uploading to or downloading from Robo-FTP Server will perform any needed line ending conversion.

Here is an article that describes the history of the line ending convention in more detail: The End-Of-Line Story.

Article last updated: 2022-01-03

Tags: EOL, line endings