Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!texbell!merch!cpe!hal6000!trsvax!slimer From: slimer@trsvax.UUCP Newsgroups: comp.sys.ibm.pc Subject: Re: How can I poll a drive? Message-ID: <216100138@trsvax> Date: 8 Sep 89 13:59:00 GMT References: <342@castle.ed.ac.uk> Lines: 45 Nf-ID: #R:castle.ed.ac.uk:342:trsvax:216100138:000:1286 Nf-From: trsvax.UUCP!slimer Sep 8 08:59:00 1989 What you would want to do is this... union REGS inregs, outregs; char drive_value; main() { /* Set up for IOCTL Function call */ inregs.h.ah = 0x44; inregs.h.al = 0x0e; /* Get Logical Drive Map */ drive_value = "C"; /* Set check for drive C */ inregs.h.bl = (drive_value - "A" + 1) intdos(&inregs,&outregs); printf("Drive %c does %sexist.",drive_value, ((outregs.x.cflag & 1) ? "not " : "")); } What this routine will do is test for the logical drive of C. If it exists, then the outregs.x.cflag test will fail and the message will be DOES EXIST. I use the function call 0x44 for interrupt 21 because it only does a system configuration block devices, it never actually accesses any disk. By placing your own values in the drive_value character, it will test for different drives. Have Fun! **************************************************************************** * Thank You, texbell!letni!rwsys!trsvax!slimer * * Bill "I do windows." - ComputerWorld * * George W. Pogue, 1300 Two Tandy, Fort Worth, TX. 76102 (817) 390-2871 * ****************************************************************************