home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.lang.c:12833 comp.os.msdos.programmer:8833
- Newsgroups: comp.lang.c,comp.os.msdos.programmer
- Path: sparky!uunet!cis.ohio-state.edu!zaphod.mps.ohio-state.edu!uwm.edu!csd4.csd.uwm.edu!rca
- From: rca@csd4.csd.uwm.edu (Robert C Allender)
- Subject: WANTED: Code to search DOS directory/subdirectories
- Message-ID: <1992Aug27.044445.22165@uwm.edu>
- Originator: rca@csd4.csd.uwm.edu
- Sender: news@uwm.edu (USENET News System)
- Organization: Computing Services Division, University of Wisconsin - Milwaukee
- Date: Thu, 27 Aug 1992 04:44:45 GMT
- Lines: 55
-
- I'm trying to find a reasonable block of code that will search through a DOS
- directory using Turbo C 3.0 in DOS mode. I had what I thought was a good
- source listing in the C User's Journal - February 1992 edition, but it won't
- compile to save my life. Has anyone else tried this code? Does anyone have
- a good program that does this? All I need to do is search every file on a
- drive and check the date stamp. If it's greater than x, set the archive bit
- to on. Pretty simple stuff.
-
- Just so I don't get anyone upset, I *did* RTFM. As a matter of fact, I called
- tech support because the FM doesn't give all the details about the
- _dos_findfirst() and _dos_findnext() functions that are supposed to do this
- kind of stuff.
-
- eg.
-
- { ...
-
- struct find_t ffblk;
- int done;
- printf("Directory of C:\\\n");
- done = _dos_findfirst("C:\\*.*",_A_SUBDIR,&ffblk);
- while(!done)
- {
- printf(" %s\n", ffblk.name);
- done = _dos_findnext(&ffblk);
- }
- return 0;
-
- } ...
-
- the _A_SUBDIR is supposed to return only DOS subdirectory entries, however it
- seems to (as do the other alternatives) also return normal files that are in
- the same directory with the directory entries.
-
- If anyone can help, I'd really appreciate it.
-
- -Rob Allender
- rca@bfs.uwm.edu -or-
- rca@csd4.csd.uwm.edu
-
-
-
-
-
- --------------------------------------------------------------------------
- | Robert C. Allender | "Exactly!" said Deep Thought. "So once you do |
- | rca@csd4.csd.uwm.edu | know what the question actually is, you'll |
- | rca@bfs.uwm.edu | know what the answer means." |
- | | -The Hitchhiker's Guide to the Galaxy |
- --------------------------------------------------------------------------
- --
-
-
-
-
-