小编Mah*_*der的帖子

ftp 服务器文件大小与实际文件大小的差异

我正在连接到 FTP 服务器以下载一些 gzipped 文件,我注意到 SIZE 命令有点令人不安,我的 google-fu 失败了。

ftp> size file0001.xml.gz
213 2524751

ftp> nlist -ltr
...
-rw-r--r--   1 anon  anons    2515727 Jan 30 00:00 file0001.xml.gz
...
Run Code Online (Sandbox Code Playgroud)

如您所见,文件大小不同 (2524751 != 2515727)。为什么?

我简要阅读了RCF0959 文件传输协议 (FTP),但没有提到 SIZE 命令,后来我发现它是协议的非标准补充。

为方便起见,以下是 RFC 中有关字节大小的信息:

  byte size

     There are two byte sizes of interest in FTP:  the logical byte
     size of the file, and the transfer byte size used for the
     transmission of the data.  The transfer byte size is always 8
     bits. …
Run Code Online (Sandbox Code Playgroud)

ftp protocol

4
推荐指数
1
解决办法
7191
查看次数

标签 统计

ftp ×1

protocol ×1