#include <dos.h>
int _is_ram_drive( const int drive );
Description
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.
Return Value
1 if the drive is a RAM drive, otherwise 0.
Portability
ANSI/ISO C
No
POSIX
No
Example
#include <stdio.h>
#include <dos.h>
int i = 4;
printf("%c: is a RAM drive: %d.\n", 'A' - 1 + i, _is_ram_drive( i ) )
Please take a moment to fill out
this visitor survey You can help support this site by
visiting the advertisers that sponsor it! (only once each, though)