|[ < ]||[ > ]||[ << ]||[ Up ]||[ >> ]||[Top]||[Contents]||[Index]||[ ? ]|
#include <dos.h> int _is_ram_drive( const int drive );
This function checks if drive number drive (1 == A:, 2 == B:, etc.) is a RAM disk. It is done by checking if the number of FAT copies (in the Device Parameter Block) is 1, which is typical of RAM disks. This doesn't have to be so, but if it's good enough for Andrew Schulman et al (Undocumented DOS, 2nd edition), we can use this as well.
1 if the drive is a RAM drive, otherwise 0.
#include <stdio.h> #include <dos.h> int i = 4; printf("%c: is a RAM drive: %d.\n", 'A' - 1 + i, _is_ram_drive( i ) )
|webmaster||delorie software privacy|
|Copyright © 2004 by DJ Delorie||Updated Apr 2004|