🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: alt.msdos.programmer
Article #1127

Re: C questions (intermediate?)

#1127
From: Stephen A. Weatherford
Date: Tue, 17 Mar 1992 20:29
25 lines
1211 bytes
veilm00@terre.DMI.USherb.CA (MARC VEILLEUX) writes:

>Here a some C questions :
>HOw can you tell if a file is already in use (like in windows)?

Don't ask me....

>HOw can you flush the keyboard buffer?

In Turbo C, simply:

	while (kbhit())
		getch();	/* while character in buffer, read it and
					discard */

>What's is the fastest way to delete all file in current dir?

Well, it depends on what you mean by fast, I suppose (to program, or
to execute....)

If you're using Turbo C, you can look at the commands findfirst(),
findnext() (which let you get the files in the directory) and unlink()
(which deletes a file).

Stephen A. Weatherford
Technical Details
Message-ID: <1992Mar17.202925.16262@csrd.uiuc.edu>
Path: arc1-ca.pugleaf.net!wupost!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!mp.cs.niu.edu!ux1.cso.uiuc.edu!csrd.uiuc.edu!sp90.csrd.uiuc.edu!weather
References: <1992Mar16.051932.18878@DMI.USherb.CA>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!wupost!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!mp.cs.niu.edu!ux1.cso.uiuc.edu!csrd.uiuc.edu!sp90.csrd.uiuc.edu!weather
From: weather@sp90.csrd.uiuc.edu (Stephen A. Weatherford)
Newsgroups: alt.msdos.programmer,alt.sources
Subject: Re: C questions (intermediate?)
Message-ID: <1992Mar17.202925.16262@csrd.uiuc.edu>
Date: 17 Mar 92 20:29:25 GMT
References: <1992Mar16.051932.18878@DMI.USherb.CA>
Sender: news@csrd.uiuc.edu
Organization: UIUC Center for Supercomputing Research and Development
Lines: 25