🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: DOS dir command - How does it work?

#3109
From: John D. Mitchell
Date: Tue, 20 Nov 1990 04:38
30 lines
1975 bytes
In article <1990Nov19.212134.6012@polyof.poly.edu> karl@polyof.poly.edu (Karl H. Muhlbach, Staff) writes:
>

>	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

Dir is a built in command for command.com.  Who knows what it does?

>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

Use the DOS functions FindFirst and FindNext.  When you find a 'file' with
it's directory attribute then you do another (recursive) walk of that
directory.  Any decent DOS internals book will have the calling information
for them.

>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.

Speed should be sufficient using the above method.

Good luck,
	John D. Mitchell
	johnm@cory.Berkeley.EDU
Technical Details
Message-ID: <9081@pasteur.Berkeley.EDU>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rutgers!apple!agate!pasteur!cinna!c164-bd
References: <1990Nov19.212134.6012@polyof.poly.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rutgers!apple!agate!pasteur!cinna!c164-bd
From: c164-bd@cinna.uucp (John D. Mitchell)
Newsgroups: comp.os.msdos.programmer,comp.windows.ms.programmer,alt.msdos.programmer
Subject: Re: DOS dir command - How does it work?
Message-ID: <9081@pasteur.Berkeley.EDU>
Date: 20 Nov 90 04:38:04 GMT
References: <1990Nov19.212134.6012@polyof.poly.edu>
Sender: news@pasteur.Berkeley.EDU
Reply-To: c164-bd@cinna.UUCP (John D. Mitchell)
Followup-To: comp.os.msdos.programmer
Distribution: usa
Organization: University of California, Berkeley
Lines: 30