| delorie.com/archives/browse.cgi | search |
| Newsgroups: | comp.os.msdos.djgpp |
| X-Comment-To: | chongkong AT my-deja DOT com |
| From: | Oleg Ossovitskii <Oleg DOT Ossovitskii AT p20 DOT f44 DOT n478 DOT z2 DOT fidonet DOT org> |
| Date: | Wed, 28 Jul 99 19:47:22 +0300 |
| Subject: | Re: getting all filename in sub-directory |
| Message-ID: | <933195113@p20.f44.n478.z2.FidoNet.ftn> |
| References: | <2610674888 AT nnrp1 DOT deja DOT com> |
| Organization: | Without C we'd have BASI, PASAL, OBOL ;-) |
| X-FTN-AREA: | HURRICANE.COMP.OS.MSDOS.DJGPP |
| X-FTN-MSGID: | 2:478/44 DOT 20 AT FidoNet DOT org 379f6d69 |
| X-FTN-REPLY: | nnrp1.deja.com 9b9bbcc8 |
| X-FTN-PID: | GED386 3.0.1-asa7 |
| X-FTN-CHRS: | IBMPC 2 |
| X-FTN-RealName: | ïÌÅÇ ïÌÅÇÏ×ÉÞ ïÓÏ×ÉÃËÉÊ ICQ UIN: 28860835 |
| X-FTN-NickName: | Stryker |
| X-FTN-Location: | Kalinigrad, West Russia |
| X-FTN-GC: | Geek-R 1.3 GPR/CC/IT/* a20 d- H- s++:- C++ c2 hw- B- F I cc pn++ D++ |
| X-FTN-GC: | O U- W+ M pr+ ln++ sl sw+ PS+ PE+ eq+ Y+ h+ sx++ b+:++ g3 m++ R- tv- |
| X-FTN-GC: | hu e:++ E:- mt+ ph+ UF co+ ck- ho- n p r x+ A+ he-- sm- sp- |
| X-FTN-Tearline: | Microsoft FidoNet Explorer/386 3.0.1-asa7 -={SCS.METALSPORT $$ }=- |
| X-FTN-Origin: | Without C we'd have BASI, PASAL, OBOL ;-) (2:478/44.20) |
| X-FTN-SEEN-BY: | 478/44 |
| X-FTN-PATH: | 478/44 |
| X-FTN-PATH: | 478/44 |
| Lines: | 44 |
| To: | djgpp AT delorie DOT com |
| DJ-Gateway: | from newsgroup comp.os.msdos.djgpp |
| Reply-To: | djgpp AT delorie DOT com |
Hello, chongkong AT my-deja DOT com, how do You do?
<óÒÅÄÁ éÀÌØ 28 1999, 03:24> chongkong AT my-deja DOT com (2:478/44.1000) wrote to All
c> is there any sample code to do a recursive process for file of a
c> certain extension from a parent directory and its sub-directory?
c> i thinking of using system("dir > tmpfilename")
c> and then checking tmpfilename.
c> or is there a much better way
c> but i really have no clue on how to go on and search all the sub-
c> directory
#include <dir.h>
use functions findfirst()/findnext()
For example:
================== Begin of Windows Clipboard =================
#include <stdio.h>
#include <dir.h>
int main(void)
{
struct ffblk ffblk;
int done;
printf("Directory listing of *.*\n");
done = findfirst("*.*",&ffblk,0);
while (!done)
{
printf(" %s\n", ffblk.ff_name);
done = findnext(&ffblk);
}
return 0;
}
=================== End of Windows Clipboard ==================
But anybody can explain me how to use ffblklfn ?
WBR, Oleg Ossovitskii MailTo: stryker AT kaliningrad DOT ru
PGP key fingerprint: 54F5 065A B916 D43C 49BA 4E1F F0DD 67C4 CBC6 422F
... Girlfriend pregnant - (M)arry (I)gnore (A)bort
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |