How do I get the file size of a large (> 4 GB) file?
Posted
by endeavormac
on Stack Overflow
See other posts from Stack Overflow
or by endeavormac
Published on 2010-05-10T04:38:50Z
Indexed on
2010/05/10
4:58 UTC
Read the original article
Hit count: 244
How can I get the file size of a file in C when the file size is greater than 4gb?
ftell returns a 4 byte signed long, limiting it to two bytes. stat has a variable of type off_t which is also 4 bytes (not sure of sign), so at most it can tell me the size of a 4gb file.
What if the file is larger than 4 gb?
© Stack Overflow or respective owner