delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/07/23/15:00:13

From: "DeHackEd" <not DOT given AT out>
Newsgroups: comp.os.msdos.djgpp
References: <99072310052600 DOT 01111 AT dome DOT calderathin DOT com>
Subject: Re: file size
Lines: 23
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: <Un2m3.2958$Vb4.18053@tundra.ops.attcanada.net>
Date: Fri, 23 Jul 1999 18:20:36 GMT
NNTP-Posting-Host: 142.194.131.1
X-Trace: tundra.ops.attcanada.net 932754036 142.194.131.1 (Fri, 23 Jul 1999 18:20:36 GMT)
NNTP-Posting-Date: Fri, 23 Jul 1999 18:20:36 GMT
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

> Does anyone know how to get the size of a file in DJGPP?
Example:


FILE *f;
long size;

f = fopen("filename.huh", "rb");
if (!f)
    return -1;
size = filelength(fileno(f));
fclose(f);
return size;


If you going to read from the file, you may want to keep it open. Just an
example. If "size" is -1, and error occurred.

--
DeHackEd
No emails, the address is fake.


- Raw text -


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