When I run this code:
<?php $handle = fopen('/tmp/lolwut', 'w') or die("Cannot open File"); fwrite($handle, "1234567890"); fclose($handle); print_r(filesize('/tmp/lolwut')); ?>
I get a result of 10 , which is the correct number of characters in the file.
However, since the file system blocks are much larger, I expected the file size to be rounded to more than 512 bytes, or even 1 KB. Why is this not so?
source share