delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/08/31/12:26:44

Date: Sun, 31 Aug 1997 19:23:44 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Rodney McConnell <rd AT enterprise DOT net>
cc: djgpp AT delorie DOT com
Subject: Re: need HELP with drives and filenames
In-Reply-To: <5u8efi$fob$2@news.enterprise.net>
Message-ID: <Pine.SUN.3.91.970831192322.17131K-100000@is>
MIME-Version: 1.0

On Sat, 30 Aug 1997, Rodney McConnell wrote:

> 1: Catch DOS errors like no disk in drive/device not ready.

In most cases, you either don't need to or can't.  These situations
usually generate Int 24h, which by default prompts with the infamous
"Abort, Retry, Fail?" message.  Since it is illegal for a DPMI program
to abort when it is in real mode (Int 24h was generated when DOS tried
to access a device, remember?), this interrupt is usually caught by
the DPMI server which silently fails the DOS call, as if the user
typed `F' to that prompt.  QDPMI is one example of a DPMI server I
know of that doesn't do that.  AFAIK, in cases like this you cannot do
anything, except take precautions not to trigger that Int 24h in the
first place.  For example, if you are going to acceess a floppy drive,
verify that there's a disk inside with a BIOS call that reads the
first track.

> 2: Loose the DOS message place disk for drive B in drive A

You mean when you typed "DIR B:" on a single-floppy systems?  There is
a couple of DOS Ioctl functions that allow you to inquire which name
(a: or b:) was used when the drive was last accessed, and to change
that for the next call.  The idea is that when the drive was last
referenced as a:, and the user types b: this time, you silently change
that to a: before calling any file-oriented functions, so DOS won't
pop up the message.

For details, look up the functions 440Eh and 440Fh of Interrupt 21h in
Ralf Brown's Interrupt List.

> 3: Detect what drives are available.

Define ``available''.  Does that include drives that can't be accessed
by DOS (e.g., there's no disk in the floppy or no CD-ROM in the CD
drive)?  If so, this might be very difficult to do reliably (for an
unreliable way, just list every drive up to what "setdisk(25)"
returns).  If you mean only the accessible drives, use the library
function `getmntent'.

> 4: Read/Write win95 long file names.

This is already in DJGPP.  If it doesn't work for you, set LFN=y in
the environment, and it will.

- Raw text -


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