`integer` or `fail`
Returns (async version): `uv_fs_t userdata`
Note: On Windows, libuv uses `CreateFileW` and thus the file
is always opened in binary mode. Because of this, the
`O_BINARY` and `O_TEXT` flags are not supported.
uv.fs_read({fd}, {size} [, {offset} [, {callback}]]) *uv.fs_read()*
Parameters:
- `fd`: `integer`
- `size`: `integer`
- `offset`: `integer` or `nil`
- `callback`: `callable` (async version) or `nil` (sync
version)
- `err`: `nil` or `string`
- `data`: `string` or `nil`
Equivalent to `preadv(2)`. Returns any data. An empty string
indicates EOF.
If `offset` is nil or omitted, it will default to `-1`, which
indicates "use and update the current file offset."
Note: When `offset` is >= 0, the current file offset will not
be updated by the read.
Returns (sync version): `string` or `fail`
Returns (async version): `uv_fs_t userdata`
uv.fs_unlink({path} [, {callback}]) *uv.fs_unlink()*
Parameters:
- `path`: `string`
- `callback`: `callable` (async version) or `nil` (sync
version)
- `err`: `nil` or `string`
- `success`: `boolean` or `nil`
Equivalent to `unlink(2)`.
Returns (sync version): `boolean` or `fail`
Returns (async version): `uv_fs_t userdata`
uv.fs_write({fd}, {data} [, {offset} [, {callback}]]) *uv.fs_write()*
Parameters:
- `fd`: `integer`
- `data`: `buffer`
- `offset`: `integer` or `nil`
- `callback`: `callable` (async version) or `nil` (sync
version)
- `err`: `nil` or `string`
- `bytes`: `integer` or `nil`
Equivalent to `pwritev(2)`. Returns the number of bytes
written.
If `offset` is nil or omitted, it will default to `-1`, which
indicates "use and update the current file offset."
Note: When `offset` is >= 0, the current file offset will not
be updated by the write.
Returns (sync version): `integer` or `fail`
Returns (async version): `uv_fs_t userdata`
uv.fs_mkdir({path}, {mode} [, {callback}]) *uv.fs_mkdir()*
Parameters:
- `path`: `string`
- `mode`: `integer` (octal representation of `chmod(1)` mode,
e.g. `tonumber('755', 8)`)
- `callback`: `callable` (async version) or `nil` (sync
version)
- `err`: `nil` or `string`
- `success`: `boolean` or `nil`
Equivalent to `mkdir(2)`.
Returns (sync version): `boolean` or `fail`
Returns (async version): `uv_fs_t userdata`
uv.fs_mkdtemp({template} [, {callback}]) *uv.fs_mkdtemp()*
Parameters:
- `template`: `string`
- `callback`: `callable` (async version) or `nil` (sync
version)
- `err`: `nil` or `string`
- `path`: `string` or `nil`
Equivalent to `mkdtemp(3)`.
Returns (sync version): `string` or `fail`
Returns (async version): `uv_fs_t userdata`
uv.fs_mkstemp({template} [, {callback}]) *uv.fs_mkstemp()*
Parameters:
- `template`: `string`
- `callback`: `callable` (async version) or `nil` (sync
version)