delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/08/15/22:30:24

From: "Johan Venter" <jventer AT writeme DOT com>
Newsgroups: comp.os.msdos.djgpp
References: <7p3u7u$ncb$1 AT nnrp1 DOT deja DOT com> <37B5BAFA DOT 504E01BB AT unb DOT ca> <7p51mk$qg2$1 AT reader1 DOT wxs DOT nl>
Subject: Re: length of file (baffling me)
Lines: 30
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2314.1300
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
Message-ID: <W0Jt3.6587$X4.13836@newsfeeds.bigpond.com>
Date: Sun, 15 Aug 1999 11:39:05 +1000
NNTP-Posting-Host: 203.40.84.151
X-Trace: newsfeeds.bigpond.com 934763702 203.40.84.151 (Mon, 16 Aug 1999 10:35:02 EST)
NNTP-Posting-Date: Mon, 16 Aug 1999 10:35:02 EST
Organization: Telstra BigPond Internet Services (http://www.bigpond.com)
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Bas Hamstra <bas DOT hamstraNOSPAM AT wxs DOT nl> wrote in message
news:7p51mk$qg2$1 AT reader1 DOT wxs DOT nl...
> fileno
> >macro.
> >
> >printf("File length: %i", filelength(fileno(fp)));
>
> Man, can''t you try to be a bit more friendly? Be nice! Just answer the
> question and don't go "if you had done this, you would have known that".

I don't think he was being unfriendly at all. He helped you with the
problem.
You really should read the docs first though.
Typing this would've saved 10k of newsgroups :-) :

info libc a filelength

which says

"This function returns the size, in bytes, of a file whose handle is
specified in the argument FHANDLE.  To get the handle of a file opened
by *Note fopen:: or *Note freopen::, you can use *Note fileno:: macro."

--
Johan Venter
ICQ 3643877
surf.to/djgppig



- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019