Re: newbie question [C language]



On Thu, 30 Jun 2005 04:27:31 -0500, Willem wrote
(in article <slrndc7eo3.3nd.willem@xxxxxxxxxxxxx>):

> Fred_NacH wrote:
>> I was wondering, how to retrieve the size/length of a file by only using
>> the ansi functions...
>
> Read from the file until you reach the end and count how much you've read.
>
> Functions (stat) that retrieve file length etc. are not in the ANSI C spec
> AKAIK, although I admit I'm not sure.

Perhaps the C FAQ will help:
http://www.eskimo.com/~scs/C-faq/q19.12.html


--
Randy Howard (2reply remove FOOBAR)

.



Relevant Pages

  • Re: newbie question [C language]
    ... how to retrieve the size/length of a file by only using ... >> the ansi functions... ... > these discussions which flare up from time to time. ... I wonder if you have ever tried it on fat binaries under OS X. ...
    (comp.programming)
  • Re: newbie question [C language]
    ... how to retrieve the size/length of a file by only using ... Functions that retrieve file length etc. are not in the ANSI C spec ... #EOT ... Prev by Date: ...
    (comp.programming)
  • Re: newbie question [C language]
    ... how to retrieve the size/length of a file by only using ... >Open the file in *binary* mode, seek to end of file, and use ftell() to see ... This won't work if you don't have read permission on the file. ... it doesn't matter if there is some magical ansi way of doing this. ...
    (comp.programming)
  • Re: Computer programmers habits in electronics
    ... is perfect in a parallel SIMD world. ... mention of it being ANSI C;) ... PeteS ... Prev by Date: ...
    (sci.electronics.design)
  • Re: How to get/set a session token
    ... HTH ... How can you retrieve a session token? ... How can you check for the existance of a session token? ... Prev by Date: ...
    (microsoft.public.dotnet.languages.csharp)