c++ - write() in sys/uio.h returns -1 -
i'm using ubuntu server 9.10 amd phenom 2 cpu g++ (ubuntu 4.4.1-4ubuntu9) 4.4.1
trying run application pftp-shit v 1.11, runs until remote file list going saved (into .pftp//pftpfxp--).
the following code in tcp.cc executed successfully:
int outfile_fd = open(name, o_creat | o_trunc | o_rdwr | o_binary) which returns file descriptor int (in case 6) - name char array containing valid path file created. , running:
fchmod(outfile_fd, s_irusr | s_iwusr); and
access(name, w_ok) the issue occurs during running function (from sys/uio.h)
write(outfile_fd, this->control_buffer, read_length) which returns -1. -1 of returned if nothing written , otherwise non-negative integer returned equal number of bytes written.
anyone having clue how can write function work?
on error, -1 returned, , errno set appropriately.
perhaps errno give hints what's wrong.
write(outfile_fd, this->control_buffer, read_length); does read_length contain correct number of bytes written?
Comments
Post a Comment