www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/08/09/15:11:03

Message-Id: <200008091910.PAA24640@delorie.com>
Date: Wed, 09 Aug 2000 22:13:34 +0200
To: ratspl AT hotmail DOT com
X-Mailer: Emacs 20.6 (via feedmail 8.2.emacs20_6 I) and Blat ver 1.8.5b
From: "Eli Zaretskii" <eliz AT is DOT elta DOT co DOT il>
CC: djgpp AT delorie DOT com
In-reply-to: <YKgk5.4683$aK5.77966@news1.online.no> (ratspl@hotmail.com)
Subject: Re: return file length...
References: <YKgk5.4683$aK5 DOT 77966 AT news1 DOT online DOT no>
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> From: "Vermin" <ratspl AT hotmail DOT com>
> Newsgroups: comp.os.msdos.djgpp
> Date: Wed, 9 Aug 2000 19:50:41 +0200
> 
> How can you get the length of a file opened using "fopen" ???

If you don't care about portability, try "filelength(fileno(fp))",
where `fp' is a pointer to the FILE object returned by `fopen'.  If
you do care about portability, use `fstat'.

In any case, if the file is open for writing, you might need to call
fflush and fsync, before calling either of these two functions, to get
the up-to-date info.

- Raw text -


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