Solved

Cheking readiness of removable media drives

Posted on 1998-09-30
5
204 Views
Last Modified: 2010-04-15
We want to write an MS-DOS utiltiy that scans for information across all drives accessible on a user's system.  However we want to skip drives that have removable media (Floppies, CD-Rom, Zip, etc).  This is especially important if there is no media loaded in the drive because it can trigger DOS's "abort, retry, fail" prompt.

We are currently accomplishing this by skipping A: and B: and using some interrupt code to check if each subsequent drive is a CD-ROM.  A customer with a ZIP drive is now haveing the ARF problem because we are not detecting the unloaded ZIP drive and skipping it.  It's an annoyance.

Can the experts suggest a way to detect when a drive with removable media is currently not ready, or perhaps a better way of deciding which drives to skip, or at least a way for a DOS app to recognize a Zip drive.
0
Comment
Question by:robworley
5 Comments
 
LVL 2

Expert Comment

by:JYoungman
ID: 1253128
Try something like

#include <bios.h>

int drive_ready(int n)
{
   unsigned u = _biosdisk(_DISK_STATUS, NULL);
   return u != 0xAA;            
}

0
 
LVL 1

Expert Comment

by:Bonev
ID: 1253129
The ARF message is shown by the default Critical Error handler. If you want to avoid it, you have to set your own handler of Int 24h.
0
 

Expert Comment

by:clwells082798
ID: 1253130
Elaine Abduction. haha.
0
 
LVL 8

Accepted Solution

by:
jhurst earned 200 total points
ID: 1253131
SInce this is the C area I assume that you can use:

harderr(your_routine)  -this function takes as a parameter a routine that you want to perform when an Abort,Retry,Fail error happens.  Basically, you can just ignore the error and recognize that you read nothing.

0
 

Author Comment

by:robworley
ID: 1253132
Thanks JHURST:  Your suggestion looks good.  One question though: I just want to ignore ARF errors while this particular function is running.  Once I am done, how do I uninstall my handler and put the default handler back in place?


CLWELLS: I don't really understand what you are saying.  Is Elain Abduction ANSI standard or specific to a given compiler?
0

Featured Post

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

An Outlet in Cocoa is a persistent reference to a GUI control; it connects a property (a variable) to a control.  For example, it is common to create an Outlet for the text field GUI control and change the text that appears in this field via that Ou…
This tutorial is posted by Aaron Wojnowski, administrator at SDKExpert.net.  To view more iPhone tutorials, visit www.sdkexpert.net. This is a very simple tutorial on finding the user's current location easily. In this tutorial, you will learn ho…
The goal of this video is to provide viewers with basic examples to understand and use pointers in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use structures in the C programming language.

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question