On Sun, 7 Jan 2007 09:48:21 -0600, Richard Heathfield wrote
(in article <Gv*********************@bt.com>):
pninja005 said:
>How does one get the correct length of a text file in standard c ?
I know ftell() does not work due to the carriage return-linefeed
translation.
There is no portable method, either for text files or for binary files,
other than reading every byte and counting as you go.
Even that isn't reliable, as files with so-called "resource forks" as
in Mac OS file systems can be larger than reported by such a method.
--
Randy Howard (2reply remove FOOBAR)
"The power of accurate observation is called cynicism by those
who have not got it." - George Bernard Shaw