Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Zortech C++ Language Reference - dos_setdrive http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
                               dos_setdrive

   Usage
   #include <dos.h>
   void     dos_setdrive(unsigned drive,unsigned *no_of_drives);

   Description
   The  function dos_setdrive changes the currently logged drive to  that
   requested  in  the  drive argument. This argument is  supplied  as  an
   unsigned  integer where 0 = drive a, 1 = drive b, 2 = drive c  and  so
   on. The second argument is a pointer to an unsigned integer into which
   the  total number of logical drives in the system is placed. The  term
   logical  drives refers to all block transfer devices in   the  system.
   This  includes  diskette (floppy disk) drives, ram  disks,   and  hard
   disks  including  those  which have been  partitioned  into   separate
   drives.

   A system fitted with a single diskette drive will return a value of  2
   in  no_of_drives.  This  is because a single  diskette  drive  can  be
   accessed as either of two logical drives, A or B.

   Example
   #include <stdio.h>
   #include <dos.h>

   main()
   {
   unsigned numdrives;

        dos_setdrive(0,&numdrives);
        printf("Total drives in the system is &d\n",numdrives);
   }


See Also: DOS_Package dos_getdrive

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson