🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Bug in TC findfirst()/findnext()!

#4873
From: Nathan Torkington
Date: Tue, 26 Feb 1991 20:29
25 lines
1888 bytes
In article <1991Feb25.192823.18224@ux1.cso.uiuc.edu> gordon@osiris.cso.uiuc.edu (John Gordon) writes:

	[program]
   ---------

	   According to the _Turbo_C_Bible_, calls to findfirst() and findnext()
   are supposed to return filenames that match *both* the given path *and* the
   given attribute.  However, the above program, which clearly specifies the
   *directory* attribute (FA_DIREC), finds both directories *and* plain files.
   Anyone have any comments/fixes/etc?

I found this too, attempting to write a ls for the PC.  You have to check the
directory attribute yourself in the ffblk.  What a pain that is.  I wrote a
	natFindFirst(...) and
	natFindNext(...)
which did the checking of attributes manually and findnexted until it got a
match or end.  Obvious, clumsy and uncouth.  You could always rewrite the
library.

Nat.
--
[  death@comp.vuw.ac.nz aka Blackadder@st1.vuw.ac.nz aka Nathan Torkington  ]
[ death dies soon.  Instead use gnat@rata.vuw.ac.nz which is less transient ]
[ "Graeme Lee ... a condom on the penis of progress"            - Bob Jones ]
[ This is not an official communication of Victoria University, Wellington. ]
Technical Details
Message-ID: <DEATH.91Feb26102938@kaukau.comp.vuw.ac.nz>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!shelby!eos!ames!uhccux!waikato.ac.nz!comp.vuw.ac.nz!death
References: <1991Feb25.192823.18224@ux1.cso.uiuc.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!shelby!eos!ames!uhccux!waikato.ac.nz!comp.vuw.ac.nz!death
From: Nathan.Torkington@comp.vuw.ac.nz (Nathan Torkington)
Newsgroups: comp.os.msdos.programmer
Subject: Re: Bug in TC findfirst()/findnext()!
Message-ID: <DEATH.91Feb26102938@kaukau.comp.vuw.ac.nz>
Date: 26 Feb 91 20:29:38 GMT
References: <1991Feb25.192823.18224@ux1.cso.uiuc.edu>
Sender: news@comp.vuw.ac.nz (News Admin)
Organization: Dept. of Computer Science, Victoria Uni. of Wellington, NZ.
Lines: 25
Nntp-Posting-Host: kaukau.comp.vuw.ac.nz
In-Reply-To: gordon@osiris.cso.uiuc.edu's message of 25 Feb 91 19:28:23 GMT