I have been examining my files and have found that the size on disk always turns out even even when size is not even.
Would this mess up my program if it created a file with an odd number of chars?
Printable View
I have been examining my files and have found that the size on disk always turns out even even when size is not even.
Would this mess up my program if it created a file with an odd number of chars?
Nope.
thanks
It may seem that way probably because the file is optimized for easier disk storing, for example the minimum "on disk" size my files have are 4 KBytes. This may also vary for different file systems.
There's a difference between logical file size and physical file size. The logical size may be any number, odd or even, from 0 to as big as the file system allows. The logical size is a multiple of the size of a disk sector.
Note also that it may not necessarily be greater than or equal to the physical size. Compressed files may have a smaller physical size than their logical size.
If the size is always even then that could be an indication that your files are UTF16 for example.