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" CC: djgpp AT delorie DOT com In-reply-to: (ratspl@hotmail.com) Subject: Re: return file length... References: 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 Precedence: bulk > From: "Vermin" > 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.