libuv / help

Need help with libuv? Post your question here.
28 stars 7 forks source link

The effect of the third parameter of uv_fs_write #155

Closed zhangwinning closed 4 years ago

zhangwinning commented 4 years ago

when I saw libuv book , there is a example about the fs.

_uv_fswrite function I understood some it, while I don't know the third params effect.

uv_fs_write(uv_default_loop(), &write_req, 1, &iov, 1, -1, on_write);

when I dig the doc,I find it is uv_file type,I don't know meaning it .

when I change the third params 1 to 2, the output is not change. when I write 3. the output is null.

bnoordhuis commented 4 years ago

It's the file descriptor. 1 and 2 are stdout and stderr respectively.

zhangwinning commented 4 years ago

@bnoordhuis thanks, I got it.