Home Explore Blog CI



neovim

40th chunk of `runtime/doc/luvref.txt`
f44e96329d8a4404f545292c9b243da9908bef2a8a2ed9240000000100000fa0

                are no more entries, `nil` is returned.

                Note: This function only has a synchronous version. See
                |uv.fs_opendir()| and its related functions for an
                asynchronous version.

                Returns: `string, string` or `nil` or `fail`

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

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

                Equivalent to `stat(2)`.

                Returns (sync version): `table` or `fail`
                - `dev` : `integer`
                - `mode` : `integer`
                - `nlink` : `integer`
                - `uid` : `integer`
                - `gid` : `integer`
                - `rdev` : `integer`
                - `ino` : `integer`
                - `size` : `integer`
                - `blksize` : `integer`
                - `blocks` : `integer`
                - `flags` : `integer`
                - `gen` : `integer`
                - `atime` : `table`
                  - `sec` : `integer`
                  - `nsec` : `integer`
                - `mtime` : `table`
                  - `sec` : `integer`
                  - `nsec` : `integer`
                - `ctime` : `table`
                  - `sec` : `integer`
                  - `nsec` : `integer`
                - `birthtime` : `table`
                  - `sec` : `integer`
                  - `nsec` : `integer`
                - `type` : `string`

                Returns (async version): `uv_fs_t userdata`

uv.fs_fstat({fd} [, {callback}])                                 *uv.fs_fstat()*

                Parameters:
                - `fd`: `integer`
                - `callback`: `callable` (async version) or `nil` (sync
                  version)
                  - `err`: `nil` or `string`
                  - `stat`: `table` or `nil` (see `uv.fs_stat`)

                Equivalent to `fstat(2)`.

                Returns (sync version): `table` or `fail` (see `uv.fs_stat`)

                Returns (async version): `uv_fs_t userdata`

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

                Parameters:
                - `path`: `string`
                - `callback`: `callable` (async version) or `nil` (sync
                  version)
                  - `err`: `nil` or `string`
                  - `stat`: `table` or `nil` (see `uv.fs_stat`)

                Equivalent to `lstat(2)`.

                Returns (sync version): `table` or `fail` (see |uv.fs_stat()|)

                Returns (async version): `uv_fs_t userdata`

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

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

                Equivalent to `rename(2)`.

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

                Returns (async version): `uv_fs_t userdata`

uv.fs_fsync({fd} [, {callback}])                                 *uv.fs_fsync()*

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

                Equivalent to `fsync(2)`.

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

                Returns (async version): `uv_fs_t userdata`

uv.fs_fdatasync({fd} [, {callback}])                         *uv.fs_fdatasync()*

                Parameters:
                - `fd`:

Title: File System Metadata and Operations: Stat, Rename, and Sync
Summary
This section describes the `uv.fs_stat()`, `uv.fs_fstat()`, `uv.fs_lstat()`, `uv.fs_rename()`, `uv.fs_fsync()`, and `uv.fs_fdatasync()` functions in libuv. It details the parameters, return values, and equivalents to standard C library functions like `stat(2)`, `fstat(2)`, `lstat(2)`, `rename(2)`, `fsync(2)`, and `fdatasync(2)`. The `stat` family of functions provides file metadata, while `uv.fs_rename()` renames a file, and `uv.fs_fsync()` and `uv.fs_fdatasync()` synchronize file data to disk. Both synchronous and asynchronous versions are covered.