www.delorie.com/djgpp/doc/libc/libc_500.html   search  
libc.a reference

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

_is_ram_drive

Syntax

 
#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 ) )


  webmaster   donations   bookstore     delorie software   privacy  
  Copyright 2004   by DJ Delorie     Updated Apr 2004