![]() |
DDraceNetwork Documentation
|
Functions | |
| int | fs_makedir (const char *path) |
| int | fs_removedir (const char *path) |
| void | fs_listdir (const char *dir, FS_LISTDIR_CALLBACK cb, int type, void *user) |
| void | fs_listdir_fileinfo (const char *dir, FS_LISTDIR_CALLBACK_FILEINFO cb, int type, void *user) |
| int | fs_makedir_rec_for (const char *path) |
| int | fs_storage_path (const char *appname, char *path, int max) |
| int | fs_executable_path (char *buffer, int buffer_size) |
| int | fs_is_file (const char *path) |
| int | fs_is_dir (const char *path) |
| int | fs_is_relative_path (const char *path) |
| int | fs_chdir (const char *path) |
| char * | fs_getcwd (char *buffer, int buffer_size) |
| const char * | fs_filename (const char *path) |
| void | fs_split_file_extension (const char *filename, char *name, size_t name_size, char *extension=nullptr, size_t extension_size=0) |
| void | fs_normalize_path (char *path) |
| int | fs_parent_dir (char *path) |
| int | fs_remove (const char *filename) |
| int | fs_rename (const char *oldname, const char *newname) |
| int | fs_file_time (const char *name, time_t *created, time_t *modified) |
Utilities for accessing the file system.
| int fs_chdir | ( | const char * | path | ) |
Changes the current working directory.
| path | New working directory path. |
| int fs_executable_path | ( | char * | buffer, |
| int | buffer_size ) |
Gets the absolute path to the executable.
| buffer | Buffer that will receive the path of the executable. |
| buffer_size | Size of the buffer. |
| int fs_file_time | ( | const char * | name, |
| time_t * | created, | ||
| time_t * | modified ) |
Gets the creation and the last modification date of a file or directory.
| name | Path of a file or directory. |
| created | Pointer where the creation time will be stored. |
| modified | Pointer where the modification time will be stored. |
| const char * fs_filename | ( | const char * | path | ) |
Gets the name of a file or folder specified by a path, i.e. the last segment of the path.
| path | Path from which to retrieve the filename. |
| char * fs_getcwd | ( | char * | buffer, |
| int | buffer_size ) |
Gets the current working directory.
| buffer | Buffer that will receive the current working directory. |
| buffer_size | Size of the buffer. |
| int fs_is_dir | ( | const char * | path | ) |
Checks if a folder exists.
| path | The path to check. |
| int fs_is_file | ( | const char * | path | ) |
Checks if a file exists.
| path | The path to check. |
| int fs_is_relative_path | ( | const char * | path | ) |
Checks whether a given path is relative or absolute.
| path | Path to check. |
| void fs_listdir | ( | const char * | dir, |
| FS_LISTDIR_CALLBACK | cb, | ||
| int | type, | ||
| void * | user ) |
Lists the files and folders in a directory.
| dir | Directory to list. |
| cb | Callback function to call for each entry. |
| type | Type of the directory. |
| user | Pointer to give to the callback. |
| void fs_listdir_fileinfo | ( | const char * | dir, |
| FS_LISTDIR_CALLBACK_FILEINFO | cb, | ||
| int | type, | ||
| void * | user ) |
Lists the files and folders in a directory and gets additional file information.
| dir | Directory to list. |
| cb | Callback function to call for each entry. |
| type | Type of the directory. |
| user | Pointer to give to the callback. |
| int fs_makedir | ( | const char * | path | ) |
Creates a directory.
| path | Directory to create. |
| int fs_makedir_rec_for | ( | const char * | path | ) |
Recursively creates parent directories for a file or directory.
| path | File or directory for which to create parent directories. |
| void fs_normalize_path | ( | char * | path | ) |
Normalizes the given path: replaces backslashes with regular slashes and removes trailing slashes.
| path | Path to normalize. |
| int fs_parent_dir | ( | char * | path | ) |
Get the parent directory of a directory.
| path | Path of the directory. The parent will be store in this buffer as well. |
| int fs_remove | ( | const char * | filename | ) |
Deletes a file.
| filename | Path of the file to delete. |
| int fs_removedir | ( | const char * | path | ) |
Removes a directory.
| path | Directory to remove. |
| int fs_rename | ( | const char * | oldname, |
| const char * | newname ) |
Renames the file or directory. If the paths differ the file will be moved.
| oldname | The current path of a file or directory. |
| newname | The new path for the file or directory. |
| void fs_split_file_extension | ( | const char * | filename, |
| char * | name, | ||
| size_t | name_size, | ||
| char * | extension = nullptr, | ||
| size_t | extension_size = 0 ) |
Splits a filename into name (without extension) and file extension.
| filename | The filename to split. |
| name | Buffer that will receive the name without extension, may be nullptr. |
| name_size | Size of the name buffer (ignored if name is nullptr). |
| extension | Buffer that will receive the extension, may be nullptr. |
| extension_size | Size of the extension buffer (ignored if extension is nullptr). |
| int fs_storage_path | ( | const char * | appname, |
| char * | path, | ||
| int | max ) |
Fetches per user configuration directory.
| appname | Name of the application. |
| path | Buffer that will receive the storage path. |
| max | Size of the buffer. |