OS/2 applications usually communicate with devices through OS/2. Some devices, like the screen, have their own set of supporting functions. Most other devices can be accessed by using the standard OS/2 file system functions- DosOpen, DosRead, DosWrite, and DosClose. Using the file system functions, an application can open and access the device just as it would a disk file. Using the file system also enables applications to redirect the device's I/O stream.

Sometimes however, these higher-level approaches do not suffice. For these situations, OS/2 provides several functions that interface with devices at a lower level. DosDevConfig is used to retrieve information about the devices available. DosPhysicalDisk can be used to retrieve information about a partitionable hard disk. DosDevIOCtl is used to send device-specific commands directly to a particular device driver.


[Back] [Next]