From the official documentation we have the following signature for
uv_fs_open
int uv_fs_open(uv_loop_t* loop, uv_fs_t* req, const char* path, int flags, int mode, uv_fs_cb cb);
open(2)
flags and mode are standard Unix flags. libuv takes care of converting to the appropriate Windows flags.
uv_fs_open(my_loop, my_req, my_filename, O_RDWR | O_CREAT, S_IRWXU, my_callback);
'O_RDWR': undeclared identifier
'O_CREAT': undeclared identifier
'S_IRWXU': undeclared identifier
uv_fs_open
To be able to use uv_fs_open
on Windows, users have to:
include fcntl.h
explicitly, because uv-win.h
doesn't include it (see this issue for further details)
use _O_CREAT
, _O_RDWR_
and so on instead of O_CREAT
, O_RDWR
and the others (see the official documentation for further details)
Something similar applies to the mode and details on the available constants can be found in the linked documentation.