Date: Sun, 7 Apr 1996 08:59:30 +0200 (IST) From: Eli Zaretskii To: Lee Braiden Cc: djgpp AT delorie DOT com Subject: Re: Detecting drives In-Reply-To: <4jvo8p$3ol@daneel.dnet.co.uk> Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Thu, 4 Apr 1996, Lee Braiden wrote: > getmntent() (or whatever it's called =) is no use to me - I'd need to > check the drives every time, since it won't show the floppy drives > unless there's a disk in them, and that could change every time, and > get getmntent() is _really_ slow.. It's not `getmntent' that is slow, it's the floppy drive! If your problem is to check the floppy drives every time, you won't be able to do much faster, because it usually takes two disk accesses to be sure there is a disk in the drive (the first access after a disk change returns an error, and you must be able to tell whether this is a real error--meaning the drive is empty--or just an indication of a new disk). In `getmntent', each disk access just reads sector 0 through a BIOS call--how much faster can you get? The only alternative is to access the floppy controller on the port level, but that won't work in some environments (e.g. WinNT) where DJGPP can run. (You could think that DOS calls are also a solution, but some DPMI servers will GP fault if you try to access an empty drive with a DOS call, so you should hook Int 24h if you want to prevent this.) Anyway, if you find a faster way, please tell about it, because maybe `getmntent' could be sped up after all.