1 fstat
Fstat gets the file length excluding the buffer length, you can use fseek or fwrite to make the fomer buffer in the file,and then use fstat to get the length again.
Another solution is to use fseek first to set to the SEEK_END, and the use ftell to show the length.
2 stat.postion
It will tell the postion inculding the buffer file.