Mail Archives: djgpp/2000/05/19/18:45:26
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 -