Filesystem: Correct size of file when writing