Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: $Revision: 1.6.2.16 $; site ima.UUCP Path: utzoo!watmath!clyde!cbosgd!ukma!psuvm.bitnet!psuvax1!burdvax!sdcrdcf!ucla-cs!ucbvax!decvax!ima!johnl From: johnl@ima.UUCP Newsgroups: net.micro Subject: Re: Need to read directories in MSDOS Message-ID: <97800018@ima.UUCP> Date: Thu, 12-Dec-85 17:36:00 EST Article-I.D.: ima.97800018 Posted: Thu Dec 12 17:36:00 1985 Date-Received: Sat, 14-Dec-85 23:31:08 EST References: <1717@druxu.UUCP> Lines: 17 Nf-ID: #R:druxu:-171700:ima:97800018:000:842 Nf-From: ima!johnl Dec 12 17:36:00 1985 /* Written 2:41 pm Dec 11, 1985 by stanwyck@druxu in ima:net.micro */ > HELP! I am trying to find a way to write a utility for PC6300 (and > compatibles) running MS-DOS. The utility requires that it be able to read > and search directories. > > I am trying to write the utility in Microsoft C, but have not been able to > find any way to open a directory for reading, or to cause the system to > return to me the contents of a directory. Use the DOS "find first" and "find next" calls, numbers 4E and 4F. They do filename pattern matching and if your pattern is, say, \foo\*.* you get all of the files in directory foo. It returns the time, date, and size of the file along with the name so you get pretty much everything you'd get from reading the directory yourself, but is much, much, easier. John Levine, ima!johnl