🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: DOS dir command - How does it work?

#3171
From: Bernt Ribbum
Date: Tue, 27 Nov 1990 02:17
35 lines
1471 bytes
valley@uchicago (Doug Dougherty) writes:

>File tree walk system call?  In DOS???  What that?

Maybe something like this (Turbo C):

#include <dir.h>

	int done;
	struct ffblk ffblk;
	char *filespec;

	done = findfirst(filespec,&ffblk,
		FA_RDONLY | FA_HIDDEN | FA_SYSTEM | FA_DIREC | FA_ARCH);

	while (!done)
	{
		/* do whatever... */

		done = findnext(&ffblk);
	}

Leaving out any of the constants FA_... will exclude files with the
corresponding attributes set.

-- 
 _--_|\    -- Bernt Ribbum, Dept of Elec & Comp Eng, Univ of Wollongong
/      \   -- PO.Box 1144, Wollongong NSW 2500, AUSTRALIA  ------------
\_.--._/   -- bernt@wolfen.cc.uow.edu.au  -----------------------------
      v
-- 
 _--_|\    -- Bernt Ribbum, Dept of Elec & Comp Eng, Univ of Wollongong
/      \   -- PO.Box 1144, Wollongong NSW 2500, AUSTRALIA  ------------
\_.--._/   -- bernt@wolfen.cc.uow.edu.au  -----------------------------
      v
Technical Details
Message-ID: <6661@wolfen.cc.uow.oz>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!cs.utexas.edu!sdd.hp.com!uakari.primate.wisc.edu!samsung!munnari.oz.au!metro!cs.uow.edu.au!wolfen!bernt
References: <1990Nov19.212134.6012@polyof.poly.edu> <valley.659638331@gsbsun>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!cs.utexas.edu!sdd.hp.com!uakari.primate.wisc.edu!samsung!munnari.oz.au!metro!cs.uow.edu.au!wolfen!bernt
From: bernt@wolfen.cc.uow.oz (Bernt Ribbum)
Newsgroups: comp.os.msdos.programmer,comp.windows.ms.programmer,alt.msdos.programmer
Subject: Re: DOS dir command - How does it work?
Message-ID: <6661@wolfen.cc.uow.oz>
Date: 27 Nov 90 02:17:23 GMT
References: <1990Nov19.212134.6012@polyof.poly.edu> <valley.659638331@gsbsun>
Organization: Uni of Wollongong, NSW, Australia
Lines: 35