Article View: comp.sys.ibm.pc
Article #14621Re: number of DOS drives
From: Jim Frost
Date: Tue, 02 Dec 1986 18:59
Date: Tue, 02 Dec 1986 18:59
47 lines
2784 bytes
2784 bytes
In article <2268@sdcsvax.UCSD.EDU> osbook@sdcsvax.UCSD.EDU (osbook) writes:
>References: <8005@watdaisy.UUCP> <1441@isis.UUCP>
>Reply-To: osbook@sdcsvax.UUCP (osbook)
>Distribution: world
>Organization: U.C. San Diego
>
>In article <1441@isis.UUCP> dragheb@isis.UUCP (Darius "OPRDRT" Ragheb) writes:
>>In article <8005@watdaisy.UUCP> dvadura@watdaisy.UUCP (Dennis Vadura) writes:
>>>
>>>Hi there, does anyone out there in net land know how you can find out from
>>>DOS what the names of physical drives active in the system are? I haven't
>>
>>I think this might work (I have not tried it):
>>use function (_FUNCTION_, not interrupt) call Eh. It will do two things:
>>make the drive selected in DL the current drive, and
>>return the number of drives in AL.
>>
>If you had tried it, you would have found out it *doesn't* work :-) :-)
>
>DOS always returns a minimum of *5* drives (this corresponds to the
>minimum value of "E" in the LASTDRIVE command in CONFIG.SYS.
>
>Harley Hahn
>osbook@sdcsvax.ucsd.edu
You're correct. The only easy way I can determine to do it is to
attempt to switch the default drive to some drive. If you get back an
error like "invalid drive" or "invalid path" (I don't have my stuff
here, so I can't check which function to call or what error number is
returned, sorry) then you know you have a nonexistent drive. Now
here's the fun stuff. Call the DOS function to find out what
LASTDRIVE is (usually E:, or 5), then try each one in decreasing order
until DOS allows you to change to it. This will find the highest
allowable drive name. Note that single floppy systems can go nuts
when you try this, since drive B: is faked.
If you want an example, email me and I'll send you a Turbo Pascal
example program (or assembler macro if you like) that does this.
--
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- Jim Frost * The Madd Hacker -
UUCP: ..!harvard!bu-cs!bucsb!madd | ARPANET: madd@bucsb.bu.edu
CSNET: madd%bucsb@bu-cs | BITNET: cscc71c@bostonu
-------------------------------+---+------------------------------------
"Oh beer, oh beer." -- Me | [=(BEER) <- Bud the Beer (cheers!)
Technical Details
Message-ID:
<623@bucsb.bu.edu.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!mnetor!seismo!columbia!rutgers!husc6!bu-cs!bucsb.bu.edu!maddReferences:
<2268@sdcsvax.UCSD.EDU>Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!columbia!rutgers!husc6!bu-cs!bucsb.bu.edu!madd From: madd@bucsb.bu.edu.UUCP (Jim Frost) Newsgroups: comp.sys.ibm.pc Subject: Re: number of DOS drives Message-ID: <623@bucsb.bu.edu.UUCP> Date: Tue, 2-Dec-86 13:59:03 EST Article-I.D.: bucsb.623 Posted: Tue Dec 2 13:59:03 1986 Date-Received: Tue, 2-Dec-86 22:08:40 EST References: <2268@sdcsvax.UCSD.EDU> Reply-To: madd@bucsb.bu.edu.UUCP (Jim Frost) Organization: Boston Univ Comp. Sci. Lines: 47