Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

File size information in C

Name: Anonymous 2010-05-29 15:30

Hey, /prog/

When you have a pointer to a FILE structure, what's the standard way of determining the size (in bytes) of the open file?

Name: Anonymous 2010-05-30 2:03

if you use fstat, make sure you use st_blksize and st_blocks to get the size, since st_size can overflow. if off_t is 32 bits, it'll overflow at 4GB. if off_t is 64 bits, it'll overflow at 16EB.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List