error check file descriptor