From owner-freebsd-questions Mon Oct 26 06:07:43 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id GAA14338 for freebsd-questions-outgoing; Mon, 26 Oct 1998 06:07:43 -0800 (PST) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from dfw-ix5.ix.netcom.com (dfw-ix5.ix.netcom.com [206.214.98.5]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id GAA14333 for ; Mon, 26 Oct 1998 06:07:42 -0800 (PST) (envelope-from graeme@echidna.com) Received: (from smap@localhost) by dfw-ix5.ix.netcom.com (8.8.4/8.8.4) id IAA14162; Mon, 26 Oct 1998 08:06:28 -0600 (CST) Received: from prn-nj1-18.ix.netcom.com(199.183.207.50) by dfw-ix5.ix.netcom.com via smap (V1.3) id rma014138; Mon Oct 26 08:06:15 1998 Message-ID: <3634AB51.1333@echidna.com> Date: Mon, 26 Oct 1998 09:03:13 -0800 From: Graeme Tait Organization: Echidna X-Mailer: Mozilla 2.02 (Win16; I) MIME-Version: 1.0 To: Peihan Wang CC: freebsd-questions@FreeBSD.ORG Subject: Re: size command under ftp References: <36346432.2DE86605@mx.cei.gov.cn> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Peihan Wang wrote: > > I am running an ftp server under FreeBSD 2.2.6. > When I do the following there is something strange. > > $ ftp localhost > ... (omit login process) > ftp> cd pub > ftp> ls > total 656 > -rw-r--r-- 1 root operator 321381 Sep 5 04:05 mc-4.1.31.tgz > ftp> size mc-4.1.31.tgz > mc-4.1.31.tgz 322545 > ftp> quit > $ > > Why does 'ls' says the file size is 321381 while 'size' indicates > that the file is 322545 bytes long ??? A slight clarification to my previous post. I said: "By default, ftp is in ascii mode" That should say, "by default the FTP server (ftpd here) is in ascii mode". When you start ftp, it says "Using binary mode to transfer files" (in the login process you omitted). That is true, but the client does not set the server transfer TYPE until you actually transfer a file. If you immediately do a "size" command after logging on, or if you do a "size" command after a command like "ls" that sets ascii mode, you will get the result you found. You might say that the client is cheating on you, by using binary mode as the default for transfers, but not setting binary mode for the "size" command. -- Graeme Tait - Echidna To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message