delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/03/05/16:51:37

Message-ID: <3AA3C0D3.23F78D8F@acm.org>
From: Eric Sosman <esosman AT acm DOT org>
X-Mailer: Mozilla 4.72 [en] (Win95; U)
X-Accept-Language: en
MIME-Version: 1.0
Newsgroups: comp.os.msdos.djgpp
Subject: Re: directory&files
References: <980qkc$lj0$1 AT pegasus DOT tiscalinet DOT it> <9fTo6.27676$c7 DOT 8015530 AT news3 DOT rdc1 DOT on DOT home DOT com>
Lines: 20
Date: Mon, 05 Mar 2001 21:35:39 GMT
NNTP-Posting-Host: 12.78.200.179
X-Complaints-To: abuse AT worldnet DOT att DOT net
X-Trace: bgtnsc06-news.ops.worldnet.att.net 983828139 12.78.200.179 (Mon, 05 Mar 2001 21:35:39 GMT)
NNTP-Posting-Date: Mon, 05 Mar 2001 21:35:39 GMT
Organization: AT&T Worldnet
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Tom St Denis wrote:
> 
> "Abacuc" <f DOT onorati AT tiscalinet DOT it> wrote in message
> news:980qkc$lj0$1 AT pegasus DOT tiscalinet DOT it...
> > How can i distinguish a file or a directory? And how can I know the
> > extensions of the files (exe, com, jpg, etc.)?
> 
> Well you can "fopen" a file not a directory... hmm...
> 
> There is no ISO-C method for what you are asking.  If you are making DJGPP
> specific requests research the "findfirst/findnext" functions.

    Another DJGPP-specific (POSIX-specific, actually) method
would be to use the stat() or fstat() function and examine the
st_mode element of the struct they fill in.  The <sys/stat.h>
header defines some helpful macros for doing this.

-- 
Eric Sosman
esosman AT acm DOT org

- Raw text -


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