Solved

Cheking readiness of removable media drives

Posted on 1998-09-30
5
206 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This is a short and sweet, but (hopefully) to the point article. There seems to be some fundamental misunderstanding about the function prototype for the "main" function in C and C++, more specifically what type this function should return. I see so…
Examines three attack vectors, specifically, the different types of malware used in malicious attacks, web application attacks, and finally, network based attacks.  Concludes by examining the means of securing and protecting critical systems and inf…
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use for-loops in the C programming language.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use nested-loops in the C programming language.

751 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