3

When I overwrite a remote file with a local copy, FileZilla successfully transfers and overwrites the file, but I notice that the new remote copy size is few KB lesser than the actual local copy. Why does this happen?

0

4 Answers 4

4

Perhaps this is related to the difference between "Size" and "Size on disk":

Size is the actual size of the file in bytes.
Size on disk is the actual amount of space being taken up on the disk.

So, if your sector size is 512 bytes and your file is actually 513 bytes, the size on disk will be 1024 bytes because it is occupying two sectors.

Because different O/S or disks may be using different sector sizes, if the reported size is the "Size on disk", then the sizes will differ.

7

meder refers, I think, to differing line ends between Linux and Windows. While *NIXes use only one character (ASCII 10) for a line break, Windows uses 2 (ASCII 13 + ACII 10).

FTP programs usually have a "Text transfer" or "ASCII transfer" mode (in comparison to a "Binary transfer" mode), that automatically converts these characters, if necessary.

So, if your file has 1000 lines, it is 1kB larger on Win than on *NIX systems.

In Filezilla you can determine the transfer mode via Transfer-> Transfer Mode in the menu bar.

There could be another reason I can think of, although it is highly unprobable. If you calculate Kilo-Bytes, you can set 1kB = 1024 Bytes (SI unit) or you can set 1KiB = 1000 Bytes (IEC unit, note the "Ki" instead of "k"). This will also result in differing sizes, but in all cases I know the sizes are calculated the same on both sides of a connection.

2
  • The transfer modes are usually called ASCII mode and Binary mode. And there is hardly ever a reason to use ASCII mode these days. Oct 22, 2009 at 7:22
  • 1
    I agree, as long as you don't use Window's Notepad *shiver*.
    – Boldewyn
    Oct 22, 2009 at 7:29
2

If the server is a different OS then that would be why ( eg server = Linux, local = Windows ). Or it could be that some bytes were killed off whether by your doing or your text editor ( whitespace is handled differently by different editors ). That would be a decent guess without actually seeing the diff between them.

1

I've noticed this discrepancy when copying files from a unix-like DOMAIN/OS system to Windows, but since I always use binary transfer (even with text files) I've had to look elsewhere for the explanation.

I noticed that on my system, the original file size is expressed as a whole number of buffers: multiples of 32kB, and that when the file is transferred, only the actual bytes of the file are counted.

But I use a strange, antique system, and I think meder's explanation is more likely to be correct.

1
  • Hm, your answer came in while I wrote an extension to mine. The cases are related, I guess.
    – Boldewyn
    Oct 22, 2009 at 7:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .