error = OpenDevice(devName, unitNumber, iORequest, flags)
D0 A0 D0 A1 D1
BYTE OpenDevice(STRPTR,ULONG,struct IORequest *,ULONG);
This function opens the named device/unit and initializes the given I/O request block. Specific documentation on opening procedures may come with certain devices.
The device may exist in memory, or on disk; this is transparent to the OpenDevice() caller.
A full path name for the device name is legitimate. For example "test:devs/fred.device". This allows the use of custom devices without requiring the user to copy the device into the system's DEVS: directory.
All calls to OpenDevice() should have matching calls to
CloseDevice()!
Devices on disk cannot be opened until after AmigaDOS has been started.
Starting with Kickstart 2.0 (V36) Tasks can safely call OpenDevice(), though AmigaDOS may open system requesters (e.g., asking the user to insert the Workbench disk if "DEVS:" is not online). You must call this function from an AmigaDOS Process if you want to turn off AmigaDOS requesters.
Prior to Kickstart 2.0 (V36), Tasks could not make OpenDevice() calls requiring disk access (since Tasks are generally not allowed to make dos.library calls). Now OpenDevice() is protected from Tasks.
AmigaDOS file names are not case sensitive, but Exec lists are. If the device name is specified in a different case than it exists on disk, unexpected results may occur. The same holds true if the device exists in memory and the device name is specified in a different case.