August 05, 2009
C Snippet #1Bob Stout
Determining a file's size
Q: HOW DO I... determine a file's size by using only ANSI functions?
A: Determining the size of a file is a function that is specific to each computer environment and, as such, wasn't addressed directly in the ANSI C standard. It is, however, possible to write such a function using only the tools ANSI has provided. C Snippet #1 shows how.
More C Snippets
All the code in C Snippets is either public domain or freeware and may therefore freely be used by the C programming community without restrictions. In most cases, if the original author is someone other than myself he or she will be identified. Thanks to all who have contributed to this collection over the years. I hope Dr. Dobb's readers will find these useful.
--Bob Stout
|
|
||||||||||||||||||||||||||||
|
|
|
|