Filesystem interaction.
More...
Go to the source code of this file.
|
| wfio |
| The root namespace for WFIO.
|
|
|
WFIO_C_BEGIN WFIO_DLL struct wfio_device_t * | wfio_device_open_file (const char *path, const char *mode, int *error) |
| Open a file located at path . More...
|
|
WFIO_DLL struct wfio_device_t * | wfio_device_open_fileEx (const char *path, wfio_openmode_t mode, int *error) |
| Open a file located at path using extended syntax. More...
|
|
WFIO_DLL wfio_openmode_t | wfio_stdio_parseMode (const char *mode, int *error) |
| Obtain an openmode for the specified STDIO mode string. More...
|
|
WFIO_DLL const char * | wfio_stdio_deriveMode (wfio_openmode_t mode, int *error) |
| Obtain an STDIO mode string for the provided mode . More...
|
|
WFIO_DLL_FASTCALL const char * | wfio_file_cwd (char *path, size_t len, int *error) |
| Obtain the path to the current working directory. More...
|
|
WFIO_DLL_FASTCALL int | wfio_file_cd (const char *path, int *error) |
| Change the current working directory to path . More...
|
|
WFIO_DLL_FASTCALL int | wfio_file_unlink (const char *path, int *error) |
| Remove path from the filesystem. More...
|
|
WFIO_DLL_FASTCALL int | wfio_file_exists (const char *path, int *error) |
| Determine if path exists. More...
|
|
WFIO_DLL_FASTCALL int | wfio_file_rename (const char *src, const char *dest, int *error) |
| Rename the path supplied by src to dest . More...
|
|
WFIO_DLL int | wfio_file_truncate (const char *path, size_t sz, int *error) |
| Trim the file at path to the specified sz . More...
|
|
Filesystem interaction.
- Author
- Phillip Kilgore
- Since
- 0.0.1
- Note
- This file may include <stdio.h>.
◆ wfio_device_open_file()
Open a file located at path
.
- Parameters
-
path | The path to attempt to open. |
mode | The STDIO mode to open the file with. |
error | An optional error indicator. |
◆ wfio_device_open_fileEx()
Open a file located at path
using extended syntax.
- Parameters
-
path | The path to attempt to open. |
mode | The openmode to open the file with. |
error | An optional error indicator. |
◆ wfio_file_cd()
Change the current working directory to path
.
- Parameters
-
path | The path to change to. |
error | An optional error indicator. |
- Returns
- Nonzero if successful; otherwise, zero.
◆ wfio_file_cwd()
Obtain the path to the current working directory.
- Parameters
-
path | The buffer to store the pathname in. |
len | The size of the buffer in bytes. |
error | An optional error indicator. |
The | current pathname on success; otherwise, NULL. |
◆ wfio_file_exists()
Determine if path
exists.
- Parameters
-
path | The path to test. |
error | An optional error indicator. |
- Returns
- Nonzero if the path exists; otherwise, zero.
◆ wfio_file_rename()
WFIO_DLL_FASTCALL int wfio_file_rename |
( |
const char * |
src, |
|
|
const char * |
dest, |
|
|
int * |
error |
|
) |
| |
Rename the path supplied by src
to dest
.
- Parameters
-
src | The path to rename. |
dest | What to rename the path to. |
error | An optional error indicator. |
- Returns
- Nonzero on success; otherwise, zero.
◆ wfio_file_truncate()
WFIO_DLL int wfio_file_truncate |
( |
const char * |
path, |
|
|
size_t |
sz, |
|
|
int * |
error |
|
) |
| |
Trim the file at path
to the specified sz
.
- Parameters
-
src | The path to truncate. |
sz | The requested file size. |
error | An optional error indicator. |
- Returns
- Nonzero on success; otherwise, zero.
◆ wfio_file_unlink()
Remove path
from the filesystem.
- Parameters
-
path | The path to unlink. |
error | An optional error indicator. |
- Returns
- Nonzero on success; otherwise, zero.
◆ wfio_stdio_deriveMode()
Obtain an STDIO mode string for the provided mode
.
- Parameters
-
mode | The openmode to look up. |
error | An optional error indicator. |
- Returns
- The parsed openmode.
◆ wfio_stdio_parseMode()
Obtain an openmode for the specified STDIO mode
string.
- Parameters
-
mode | The mode string to parse. |
error | An optional error indicator. |
- Returns
- The parsed openmode.