www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/05/19/18:45:26

Message-ID: <3925C0BA.9BC04FA4@gtcom.net>
From: Krogg <krogg DOT no DOT to DOT spam AT gtcom DOT net>
X-Mailer: Mozilla 4.61 [en] (Win95; U)
X-Accept-Language: en,en-US,en-GB,ja,af
MIME-Version: 1.0
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Directory listing
References: <Pine DOT SUN DOT 3 DOT 91 DOT 1000518115130 DOT 12245T-100000 AT is> <3924B7F6 DOT 28989BA7 AT gtcom DOT net> <200005191229 DOT IAA23656 AT indy DOT delorie DOT com>
Lines: 60
Date: Fri, 19 May 2000 18:31:22 -0400
NNTP-Posting-Host: 12.16.178.156
X-Trace: eagle.america.net 958775575 12.16.178.156 (Fri, 19 May 2000 18:32:55 EDT)
NNTP-Posting-Date: Fri, 19 May 2000 18:32:55 EDT
Organization: 24hoursupport.com
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Eli Zaretskii wrote:
> 
> > From: Krogg <krogg DOT no DOT to DOT spam AT gtcom DOT net>
> > Newsgroups: comp.os.msdos.djgpp
> > Date: Thu, 18 May 2000 23:41:42 -0400
> >
> > Eli Zaretskii wrote:
> > >
> > > On Wed, 17 May 2000, Krogg wrote:
> > >
> > > > What i want in the listing is all files that match "*.c"
> > > > and the names of the subdirectories....
> > > >
> > > > here is my sample code...how can i change it to
> > > > print out the subdirectories and the "*.c" files?
> > >
> > > Pass "*.*" to findfirst, then use the fnmatch function to filter the
> > > files which match the "*.c" pattern.
> >
> > I can just use "*.c" in the findfirst function and
> > get the same result.
> 
> This won't get you the subdirectories.  I thought your problem was to
> get *.c files *and* subdirectories, no?

it was...
 
> > How do i filter subdirectories from the list?
> 
> They have a special attribute bit set in the ff_attrib member of
> struct ffblk.

Its the omission of this information that confused me....

The ff_attrib member isnt documented verywell in the libc-202 
documentation,I thought it only told if a file was H/S/A/R.....

I DID play around with it a little last night though,and figured
out that the ff_atrib member was different for dir's,I just didnt
know if it was a particular bit that was set or a static value
that was returned...but now i know.

I dont know which bit tells if you got a directory,but I do
know how to figure it out....

Thanks for your suggestions.....



-- 


|"""""<`.THE PRINCE ,'>"""""""""""""""""""""""""""""""""""|
|      `.`/""""""\,','            my sig is too big,      |
|SEE HIS (  /   \ \' SEE HIS      but its really cool.    |
| FACE    \/<> <>\/   SMILE                               |
|         /   W   \          Visit my ascii art site:     |
|       ,'\_|||||_/`.  http://www.gtcom.net/~krogg/ascii/ |
|     ,','   |||   `.`.     krogg DOT no DOT to DOT spam AT gtcom DOT net    |
|____<,' TIME TO DIE `.>____Remove no.to.spam to reply____|

- Raw text -


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