If you use the function DIRECTORY on a drive which isn't ready, OS/2 always pops up this nice little error box. There's no way to avoid this (No, even an active trap for NOTREADY conditions will do that).
For a workaround for this behavior see Check if a directory exists
Note: The DLL RXU contains a function to enable and disable popups for hard errors and exceptions.
In OS/2 WARP the function DIRECTORY fails if the name of the directory is too long (more than 132 chars). This bug is fixed in the WARP 3 FixPack (Source: APAR PJ19343).