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?
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?
Last edited by Once-ler; 03-02-2013 at 03:51 AM.
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.
Devoted my life to programming...
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.
My homepage
Advice: Take only as directed - If symptoms persist, please see your debugger
Linus Torvalds: "But it clearly is the only right way. The fact that everybody else does it some other way only means that they are wrong"