struct stat st_blocks and st_blksize
I'm writing some code which should find the 'size' of a file in bytes, and the 'size on disk' of the file - the size considering the wasted space considering clusters.
This is no problem - using:
struct stat attrib;
size = attrib.st_size;
sizeOnDisk = (attrib.st_blocks * attrib.st_blksize);
I can get the correct values. This will compile fine in g++ etc but trying to get it to compile in Borland compiler, I find that st_blocks and st_blksize are not members of struct stat.
Is there another method I can use to get these values?
Thanks in advance