added support for opening files non-blocking