write() in sys/uio.h returns -1
- by fredrik
I'm using
Ubuntu Server 9.10
AMD Phenom 2 cpu
g++ (Ubuntu 4.4.1-4ubuntu9) 4.4.1
trying to run the application pftp-shit v 1.11.
The following code in tcp.cc is executed successfully:
int outfile_fd = open(name, O_CREAT | O_TRUNC | O_RDWR | O_BINARY)) which returns a file descriptor int (in my case 6) - name is a char array containing a valid path to my file which successfully i created.
and successfully running:
fchmod(outfile_fd, S_IRUSR | S_IWUSR); and access(name, W_OK)
The issue occurs during running the function (from sys/uio.h) write(outfile_fd, this-control_buffer, read_length)
which returns -1. -1 is of returned if nothing was written and otherwise a non-negative integer is returned which is equal to the number of bytes written.
Anyone having a clue how I can get the write function to work?