Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!gatech!udel!new From: new@udel.EDU (Darren New) Newsgroups: comp.sys.ibm.pc Subject: Re: DOS directory access Keywords: function dos c directory Message-ID: <18530@louie.udel.EDU> Date: 26 Jun 89 21:37:49 GMT References: <33856@tention.uucp> <238@helens.Stanford.EDU> Sender: usenet@udel.EDU Reply-To: new@udel.EDU (Darren New) Distribution: usa Organization: University of Delaware Lines: 15 In article <238@helens.Stanford.EDU> mike@relgyro.STANFORD.EDU (Mike Macgirvin) writes: > To speed up your program, I recommend allocating space for the entire >directory, gobbling it up with one read(), and then you have duplicated >what DOS does. Your program can then scan through this memory as it wishes. Actually, last I looked (PC-DOS 3.1) it was still impossible to read a directory as a standard file. You could use Examine and ExamineNext. As long as there are no intervening DOS calls, it should be fairly fast. If you are (say) deleting files, you may wish to ChangeDir to the directory and use the FCB-oriented directory calls rather than the Unix-like calls, because such calls parse the wildcards all at once. This is why delete is so fast in COMMAND.COM. However, it can cause bugs sometimes (like while networking, if I remember). Anyway, if you use Examine and ExamineNext without intervening calls, all the directories should be buffered for you. Good luck... -- Darren