delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/05/24/14:45:08

From: Nate Eldredge <neldredge AT hmc DOT edu>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: code snippet trouble
Date: 24 May 2001 11:39:55 -0700
Organization: MindSpring Enterprises
Lines: 35
Sender: nate AT mercury DOT bitbucket
Message-ID: <83n182381w.fsf@mercury.bitbucket>
References: <GG5P6.190356$2q DOT 6453960 AT news DOT chello DOT at> <2593-Thu24May2001195721+0300-eliz AT is DOT elta DOT co DOT il> <001601c0e479$71268720$0700a8c0 AT chello DOT at>
NNTP-Posting-Host: a5.f7.db.90
Mime-Version: 1.0
X-Server-Date: 24 May 2001 18:39:56 GMT
User-Agent: Gnus/5.0802 (Gnus v5.8.2) Emacs/20.5
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

"Maverick" <vhd AT chello DOT at> writes:

> I got it working without crashing, but I still don't know if it is completly
> right that way. Lem'me explain, to straigthen the thing out I want to do.
> This thing should do the following :
> 
> Check for a match with _dos_firstfind() and if this match is found and loop
> with _dos_findnext() until no more matches are found. I wrote it this way,
> since I bet _dos_findnext() will be excuted after the loop, and if it finds
> a match will recall the loop, until no more file matches are found. It
> should work this way.

But in the code you posted, you don't do anything with those
additional matches.  So what's the use of finding them?

> I use _dos-syntaxes simply because I want compatibility in DOS as well. I
> might be working on another machine some of the stuff, and then I'd be
> pretty messed up since that machine can't even handle WIN95, unless I am
> badly informed and findfirst() doesn't care if it is WIN or not.

You are.  findfirst works perfectly well on Windows or DOS.  glob
might be an even better choice, as it will support fancier wildcards
and long file names.

> Btw : Do you know how to clear the keyboard buffer after calling bioskey(1)?

I believe you could use something like

while (kbhit())
        getch();

-- 

Nate Eldredge
neldredge AT hmc DOT edu

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019