Page is a not externally linkable
- Hardware and OS Related Technologies
-- Linux, Unix, and *nix like Operating Systems
---- Is this *nix or NT?


RobinC - 11:31 pm on Jan 18, 2004 (gmt 0)


I've actually coded a commercial ftp server from scratch (niche market though) ;-)

There is no "standard" reply to the SYST command, instead most servers reply what their OS is. However there are some ftp *clients* that change their behaviour depending on what OS they get back, even though it makes no difference (as it's the server itself that changes, the OS can run multiple different ones with different outputs).

The "UNIX Type: L8" is taken by a lot of people to mean the LIST reeply type, and the length of a byte, myself included - it's only meant to be human readable, not parsed for anything ;-)

The ASCII/Binary is just MODE, the ftp specs say that binary is send-as-is, ascii however gets the linefeeds translated to a neutral type (/n/r etc), so the client end can use a different system than the server end (ie, windows and *nix). It's only applicable for ascii files, and a listing is ascii... Unless it's got characters outside the 7-bit boundary that certain systems complain about ;-)

The reason ftp servers tend to "lie" about what they are is that the LIST output was not meant to be machine parsed - there's no actual standard to it. Instead a lot of people are now just using the output of *nix "ls -alF" as an unofficial standard - in fact, a lot of ftp clients will actually send "LIST -alF" as the command (who say's we're a. running on *nix, and b. actually running an external prog for listings?).

What can I say, coding ftp servers can be a headache, just got for wu-ftpd output compatability and everyone should be happy ;-)

Robin


Thread source:: http://www.webmasterworld.com/linux/932.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com