Home Explore Blog CI



neovim

44th chunk of `runtime/doc/luvref.txt`
10e9b9150ee13be2915beb4fd52517b05506325a0d23e57f0000000100000fa1
 `callback`.

                Returns (sync version): `boolean` or `fail`

                Returns (async version): `uv_fs_t userdata`

uv.fs_readlink({path} [, {callback}])                         *uv.fs_readlink()*

                Parameters:
                - `path`: `string`
                - `callback`: `callable` (async version) or `nil` (sync
                  version)
                  - `err`: `nil` or `string`
                  - `path`: `string` or `nil`

                Equivalent to `readlink(2)`.

                Returns (sync version): `string` or `fail`

                Returns (async version): `uv_fs_t userdata`

uv.fs_realpath({path} [, {callback}])                         *uv.fs_realpath()*

                Parameters:
                - `path`: `string`
                - `callback`: `callable` (async version) or `nil` (sync
                  version)
                  - `err`: `nil` or `string`
                  - `path`: `string` or `nil`

                Equivalent to `realpath(3)`.

                Returns (sync version): `string` or `fail`

                Returns (async version): `uv_fs_t userdata`

uv.fs_chown({path}, {uid}, {gid} [, {callback}])                 *uv.fs_chown()*

                Parameters:
                - `path`: `string`
                - `uid`: `integer`
                - `gid`: `integer`
                - `callback`: `callable` (async version) or `nil` (sync
                  version)
                  - `err`: `nil` or `string`
                  - `success`: `boolean` or `nil`

                Equivalent to `chown(2)`.

                Returns (sync version): `boolean` or `fail`

                Returns (async version): `uv_fs_t userdata`

uv.fs_fchown({fd}, {uid}, {gid} [, {callback}])                 *uv.fs_fchown()*

                Parameters:
                - `fd`: `integer`
                - `uid`: `integer`
                - `gid`: `integer`
                - `callback`: `callable` (async version) or `nil` (sync
                  version)
                  - `err`: `nil` or `string`
                  - `success`: `boolean` or `nil`

                Equivalent to `fchown(2)`.

                Returns (sync version): `boolean` or `fail`

                Returns (async version): `uv_fs_t userdata`

uv.fs_lchown({fd}, {uid}, {gid} [, {callback}])                 *uv.fs_lchown()*

                Parameters:
                - `fd`: `integer`
                - `uid`: `integer`
                - `gid`: `integer`
                - `callback`: `callable` (async version) or `nil` (sync
                  version)
                  - `err`: `nil` or `string`
                  - `success`: `boolean` or `nil`

                Equivalent to `lchown(2)`.

                Returns (sync version): `boolean` or `fail`

                Returns (async version): `uv_fs_t userdata`

uv.fs_copyfile({path}, {new_path} [, {flags} [, {callback}]]) *uv.fs_copyfile()*

                Parameters:
                - `path`: `string`
                - `new_path`: `string`
                - `flags`: `table`, `integer`, or `nil`
                  - `excl`: `boolean`
                  - `ficlone`: `boolean`
                  - `ficlone_force`: `boolean`
                - `callback`: `callable` (async version) or `nil` (sync
                  version)
                  - `err`: `nil` or `string`
                  - `success`: `boolean` or `nil`

                Copies a file from path to new_path. If the `flags` parameter
                is omitted, then the 3rd parameter will be treated as the
                `callback`.

                Returns (sync version): `boolean` or `fail`

                Returns (async version): `uv_fs_t userdata`

uv.fs_opendir({path} [, {callback} [, {entries}]])             *uv.fs_opendir()*

                Parameters:
                - `path`: `string`
                - `callback`: `callable` (async version) or `nil` (sync
                  version)
                  - `err`:

Title: File System Operations: Readlink, Realpath, Chown, Copyfile, Opendir
Summary
This section details file system operations including `uv.fs_readlink` (reads the value of a symbolic link), `uv.fs_realpath` (canonicalizes a pathname by resolving symbolic links and removing '..' components), `uv.fs_chown`, `uv.fs_fchown`, and `uv.fs_lchown` (change file ownership), `uv.fs_copyfile` (copies files with optional flags for exclusive creation and cloning), and `uv.fs_opendir` (opens a directory). Each function's parameters, return values for synchronous and asynchronous versions, and their C counterparts are described.