Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Cheking readiness of removable media drives

Posted on 1998-09-30
5
Medium Priority
?
208 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 400 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Preface I don't like visual development tools that are supposed to write a program for me. Even if it is Xcode and I can use Interface Builder. Yes, it is a perfect tool and has helped me a lot, mainly, in the beginning, when my programs were small…
Windows programmers of the C/C++ variety, how many of you realise that since Window 9x Microsoft has been lying to you about what constitutes Unicode (http://en.wikipedia.org/wiki/Unicode)? They will have you believe that Unicode requires you to use…
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use while-loops in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use switch statements in the C programming language.

688 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