From: "DeHackEd" 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: 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.