🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.msdos.programmer
Article #3114

Re: DOS dir command - How does it work?

#3114
From: Lon Anderson
Date: Tue, 20 Nov 1990 17:24
42 lines
2323 bytes
karl@polyof.poly.edu (Karl H. Muhlbach, Staff) writes:


>Dear Fellow Netters:

>	I am writing a little utility but I need to get some
>insight on something.  I was wondering how DOS accomplishes the dir command.
>Is it done via the DOS system calls or is it bios related?  The reason I
>ask is that part of my utility is to read a diskette and reference every
>file on the diskette to see its file attributes (ie. size, date,
>permissions, etc.). Unlike DOS I need to traverse the tree structure to
>recursively reference every file.  DOS will only indicate that a
>particular file is a subdirectory and not change dir to reference the files
>in it.  I was considering using the ftw (file tree walk) system call but
>was concerned about the max. open file limitation of 20.  Could anyone shed
>some light on this for me.  This aspect and its speed performance are the
>only things holding back the efficient completion of the utility.  I have
>it working with referencing the disk using the ftw call but there must be a
>more efficient and quicker method.

>	I would greatly appreciate any help that might be sent my way.
>Please EMail me any responses so that I may have a quicker turn around time
>on an answer since I do not get much time to read news.  Also, if your
>response is to RTFM then fine, point me in the direction of a decent book
>on DOS internals and I will RTFM! The books I have seen do not go into
>stuff like this.

>					Thanks to all
>					in advance!

>						Karl M.


>-- 
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>  Karl H. Muhlbach   	Email: karl@polyof.poly.edu
>			Voice: (516) 794-0142
>			  FAX: (516) 794-0142  

The DOS dir command uses the FCB FindFirst and FindNext int 21h functions.

Lon Anderson
Technical Details
Message-ID: <lorena.659121873@dragon2>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!cs.utexas.edu!hellgate.utah.edu!caen!sdd.hp.com!usc!apple!voder!pyramid!infmx!dragon2!lorena
References: <1990Nov19.212134.6012@polyof.poly.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!cs.utexas.edu!hellgate.utah.edu!caen!sdd.hp.com!usc!apple!voder!pyramid!infmx!dragon2!lorena
From: lorena@informix.com (Lon Anderson)
Newsgroups: comp.os.msdos.programmer,comp.windows.ms.programmer,alt.msdos.programmer
Subject: Re: DOS dir command - How does it work?
Message-ID: <lorena.659121873@dragon2>
Date: 20 Nov 90 17:24:33 GMT
References: <1990Nov19.212134.6012@polyof.poly.edu>
Sender: news@informix.com (Usenet News)
Organization: Informix Software, Inc.
Lines: 42