EBADF or EINVAL The fd is not open for writing. Opening it with "w+" works here. HTH, Bernard. -- Bernard Blackham <bernard at blackham dot com dot au>