I am now working on Mac OS X, and I make myself a MYFileHandle class. This class implements file operation like NSFileHandle by POSIX system call (like read(), write(), etc), but would provide more status values.
But I met a problem. If the file descriptor was set to a remote disk in local network (for example, a shared folder of a Windows system). When the connection was lost, the write()
system call will block.
In this situation, is there any way to check the availability of the given file descriptor before calling the "write()" function? Or can I make the "write()" returns immediately after its operation is failed instead of blocking?