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++ 3.0r4 - <b>dos_setdrive</b> 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 1 = A:, 2 = B:, 3 = 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>
   #include <stdlib.h>

   int main()
   {

       unsigned numdrives;

       dos_setdrive(1,&numdrives);
       printf("Total drives in the system is %d\n"
           ,numdrives);
       printf("Current drive is now a: \n");
       return EXIT_SUCCESS;
   }

See Also

   DOS package, dos_getdrive



See Also: dos_getdrive

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