delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/11/01/07:17:23

From: Damian Yerrick <Bullcr_pd_yerrick AT hotmail DOT comRemoveBullcr_p>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: filelength(): POSIX or not
Organization: Pin Eight Software http://pineight.8m.com/
Message-ID: <753uvso5d74rfdhndnrc98aoksgl0i7hvp@4ax.com>
References: <972911905 DOT 508266 AT shelley DOT paradise DOT net DOT nz>
X-Newsreader: Forte Agent 1.7/32.534
MIME-Version: 1.0
Lines: 24
X-Trace: /K0ZEE7Aqmx4Gv+uAgeiyCeYQ/DFsAPUVZZt5pjAzO5EQw5ZP8D+8aklF3WhG3zmUKb+SEXzbRJQ!NrgH64tz8H4YWqPeIE25AJpbsqDvaKBwRtQMCvmeGafD540+/1TueEGGqUSTkLiBTVY/Wv8mKIzT!/9W5QA==
X-Complaints-To: abuse AT gte DOT net
X-Abuse-Info: Please be sure to forward a copy of ALL headers
X-Abuse-Info: Otherwise we will be unable to process your complaint properly
NNTP-Posting-Date: Tue, 31 Oct 2000 18:18:05 GMT
Distribution: world
Date: Tue, 31 Oct 2000 18:18:05 GMT
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

On Tue, 31 Oct 2000 02:19:45 +1300, "Edmund Horner"
<ejrh AT paradise DOT net DOT nz> wrote:

>While looking for a substitute "filelength()" for use under Linux, I came
>upon the source for the DJGPP filelength():
>
>src/libc/posix/sys/stat/filelen.c
>
>Does this mean that filelength() _is_ a POSIX function?  According to its
>info page, it's "not POSIX".

here's your substitute:

fopen() the file in "rb" mode, fseek() to the end, and read the
length with ftell().  This is ANSI so it should work on any full
ANSI C compiler.

-- 
<O
( \   GNOME vs. KDE: the game!
 X    http://pineight.8m.com/nes.htm

This is McAfee VirusScan. Add these two lines to your signature to
prevent the spread of signature viruses.  http://www.mcafee.com/

- Raw text -


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