Category : File Managers
Archive   : CASP421.ZIP
Filename : ISDEV.C

 
Output of file : ISDEV.C contained in archive : CASP421.ZIP
/*
* ISDEVICE - Will invoke Ms-Dos IOCTL function to "get" the attributes of
* the specified DOS handle.
*
* Result := True If the specified handle is a device. := False If the
* specified handle is a file.
*
* Caution: A True return only indicates that the handle is assigned to a device
* driver. These include the CON, PRN, AUX and any user installed device
* drivers.
*
* A False return indicates that the handle is assigned to a file that may be on
* a Floppy, Hard Disk or Ram Disk.
*/

#include
#include

int
isdevice (int handle) {
union REGS R;

R.x.ax = 0x4400; /* MS-DOS IOCTL "Get" function */
R.x.bx = handle; /* ... Handle for IOCTL "Get" */
R.x.dx = 0;
intdos(&R, &R); /* ... MS-DOS Entry Interrupt */
if ((R.x.dx & 0x80) == 0) return (0);
else return (1);
}


  3 Responses to “Category : File Managers
Archive   : CASP421.ZIP
Filename : ISDEV.C

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/