File size differences after copying a file to a server vía FTP File size differences after copying a file to a server vía FTP python python

File size differences after copying a file to a server vía FTP


Do you need to open the locfile in binary using rb?

f = open (locfile, "rb")


Well if you go under the properties of your file in Windows or a *nix environment, you will notice two sizes. One is the sector size, and one is the actual size. The sector size is the number of sectors in bytes that are used up on your hard disk. That is because two files cannot be in the same sector with most modern file systems, so if your file fills up half of the sector the whole sector is marked as filled.

So you might be comparing the sector file size to the actual file size on the FTP server or vice versa.


Small files take up a whole node on the file system whatever the size is.

My host tends to report all small files as 4KB in ftp but gives an accurate size in a shell so it might be a 'feature' common to ftp clients.