delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/05/18/01:03:30

Message-ID: <39235740.11D751AF@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: Directory listing
Lines: 34
Date: Wed, 17 May 2000 22:36:48 -0400
NNTP-Posting-Host: 12.6.67.200
X-Trace: eagle.america.net 958617469 12.6.67.200 (Wed, 17 May 2000 22:37:49 EDT)
NNTP-Posting-Date: Wed, 17 May 2000 22:37:49 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

I want to use findfirst and findnext to get a directory listing,but i
have run into a problem....

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?
I have tried _everything_ i could think of but
i get no success...


#include <stdlib.h>
#include <dir.h>

int main(void)
{

 struct ffblk f;
 int done = findfirst("", &f,FA_DIREC);

 while (!done)
 {
  printf("%s\n",f.ff_name);
  done = findnext(&f);
 }

 return 0;
}



-- 
Krogg

- Raw text -


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