Stat functions.
More...
Go to the source code of this file.
|
int | stat (const char *path, stat_t *buf) |
| Retrieves information about the file at the given location. More...
|
|
int | fstat (int fd, stat_t *buf) |
| Retrieves information about the file at the given location. More...
|
|
int | mkdir (const char *path, mode_t mode) |
| Creates a new directory at the given path. More...
|
|
int | rmdir (const char *path) |
| Removes the given directory. More...
|
|
int | creat (const char *path, mode_t mode) |
| Creates a new file or rewrite an existing one. More...
|
|
Stat functions.
- Copyright
- (c) 2014-2024 This file is distributed under the MIT License. See LICENSE.md for details.
◆ creat()
int creat |
( |
const char * |
path, |
|
|
mode_t |
mode |
|
) |
| |
Creates a new file or rewrite an existing one.
- Parameters
-
path | path to the file. |
mode | mode for file creation. |
- Returns
- file descriptor number, -1 otherwise and errno is set to indicate the error.
It is equivalent to: open(path, O_WRONLY|O_CREAT|O_TRUNC, mode)
◆ fstat()
int fstat |
( |
int |
fd, |
|
|
stat_t * |
buf |
|
) |
| |
Retrieves information about the file at the given location.
- Parameters
-
fd | The file descriptor of the file that is being inquired. |
buf | A structure where data about the file will be stored. |
- Returns
- Returns a negative value on failure.
◆ mkdir()
int mkdir |
( |
const char * |
path, |
|
|
mode_t |
mode |
|
) |
| |
Creates a new directory at the given path.
- Parameters
-
path | The path of the new directory. |
mode | The permission of the new directory. |
- Returns
- Returns a negative value on failure.
◆ rmdir()
int rmdir |
( |
const char * |
path | ) |
|
Removes the given directory.
- Parameters
-
path | The path to the directory to remove. |
- Returns
- Returns a negative value on failure.
◆ stat()
Retrieves information about the file at the given location.
- Parameters
-
path | The path to the file that is being inquired. |
buf | A structure where data about the file will be stored. |
- Returns
- Returns a negative value on failure.