www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/04/07/01:10:00

Date: Sun, 7 Apr 1996 08:59:30 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Lee Braiden <Lee_B AT Celestia DOT dnet DOT co DOT uk>
Cc: djgpp AT delorie DOT com
Subject: Re: Detecting drives
In-Reply-To: <4jvo8p$3ol@daneel.dnet.co.uk>
Message-Id: <Pine.SUN.3.91.960407084756.22284J-100000@is>
Mime-Version: 1.0

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.

- Raw text -


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