File size in windows and linux

Asked

Viewed 424 times

0

I am transferring files through (FILEZILLA FTP Client) from my local machine that runs XAMPP/Windows8, but when placing the file on the LINUX server the files suffer a variation in size.

Ex:

c:\xampp\htdocs\app\arquivo.php :: Filesize 3.110 kb no windows
#apos fazer o upload par o servidor linux fica assim:
/home/app/public_html/arquivo.php :: Filesize 3.018 kb no linux 

The file remains the same, runs the normal script, no errors

The question is:

Is this change in file size when transferring normal? And why does this happen?

  • Maybe at the time of transfer the characters \r are removed. Also note that Windows has "size" and "disk size". I removed the php tag as the problem does not involve it. I just won’t try to formulate a friendly answer, because your question is off-topic.

  • I did the test I passed a file via ASCII and the size was equal and there was no loss of \r, the only thing that is different is the disk size, in Windows: size: 15.9 KB (16,359 bytes)/disk size: 16.0 KB (16,384 bytes) --- Server: 16,359 bytes so I believe you’re just looking in the wrong place.

  • @Guilhermenascimento is not the disk size, it is the same size by clicking on file properties by windows it shows the same size in bytes as Filezilla.

  • @Guilhermenascimento I tested in ASCII and Binary and it worked. You have to transfer in Binary to be equal.

  • Your file is using \r\n or \n for line breaks? If using \r\n, try downloading the file from the server that is smaller and see if it recovers the original size. If the size has returned to the original, then I believe it may be your FTP application that is having "some" problem. I am using Filezilla 3.10.3

  • This is not a question directly related to programming and is to be removed. Consider using one of the other network.

Show 1 more comment

1 answer

2


  • Stream ASCII files as Binary? It will give problem.

  • Binary transfer mode does byte to byte copy, that’s all.

  • I transmitted in ASCII and the size and line breaks have not changed.

  • @Your answer helped, I have to transfer to Inary to look the same. Question: How there can be errors when transferring from Binary and ASCII or vice versa. I should always leave in AUTO or I should select one of the two and use as a standard?

  • I don’t think it’s likely \r the problem, it may be some "Binaria" information inside the PHP file. Unless it is some BUG in Filezilla, the line breaks do not change.

  • What is more correct, whether text, binary or automatic mode? I think it depends on your goal. If it is necessary to edit the text file in both Windows and Linux, the text or automatic mode will suit well, as it will do the necessary conversion. If the copy is just to make a backup for later download, with edits of the text file always in Windows, the binary mode meets well.

Show 1 more comment

Browser other questions tagged

You are not signed in. Login or sign up in order to post.