Hm?
Given that we want the needed amount of free disk-space, we'll have to look at how much is actually allocated. On *nix with a filesystem supporting sparse files, that does not correspond to the position of the last write. However, you can get the number of allocated blocks by using stat, which on *nix returns the number of allocated 512b blocks in the variable st_blocks.