This would only write 1 buffer if I call uv_fs_write with this 3 buffers: "foo", "", "bar", IMHO the while condition needs to be adjusted to r > = 0.