|
N64FlashcartMenu
|
File system utility functions for file and directory operations. More...
Go to the source code of this file.
Macros | |
| #define | FS_SECTOR_SIZE (512) |
| The size of a file system sector in bytes. | |
Functions | |
| char * | strip_fs_prefix (char *path) |
| Strip the file system prefix from a path. | |
| char * | file_basename (char *path) |
| Get the basename of a path. | |
| bool | file_exists (char *path) |
| Check if a file exists at the given path. | |
| int64_t | file_get_size (char *path) |
| Get the size of a file at the given path. | |
| bool | file_allocate (char *path, size_t size) |
| Allocate a file of the specified size at the given path. | |
| bool | file_fill (char *path, uint8_t value) |
| Fill a file with the specified value. | |
| bool | file_has_extensions (char *path, const char *extensions[]) |
| Check if a file has one of the specified extensions. | |
| bool | directory_exists (char *path) |
| Check if a directory exists at the given path. | |
| bool | directory_create (char *path) |
| Create a directory at the given path. | |
File system utility functions for file and directory operations.
| char * strip_fs_prefix | ( | char * | path | ) |
Strip the file system prefix from a path.
Removes the file system prefix (such as ":/") from the provided path string.
| path | The path from which to strip the prefix. |
| char * file_basename | ( | char * | path | ) |
Get the basename of a path.
Returns a pointer to the basename (the final component) of the provided path.
| path | The path from which to get the basename. |
| bool file_exists | ( | char * | path | ) |
Check if a file exists at the given path.
Checks if a file exists at the specified path.
| path | The path to the file. |
| int64_t file_get_size | ( | char * | path | ) |
Get the size of a file at the given path.
Returns the size of the file at the specified path in bytes.
| path | The path to the file. |
| bool file_allocate | ( | char * | path, |
| size_t | size ) |
Allocate a file of the specified size at the given path.
Creates a file of the specified size at the provided path. The file is filled with zeros.
| path | The path to the file. |
| size | The size of the file to create in bytes. |
| bool file_fill | ( | char * | path, |
| uint8_t | value ) |
Fill a file with the specified value.
Fills the file at the given path with the specified byte value.
| path | The path to the file. |
| value | The value to fill the file with (byte). |
| bool file_has_extensions | ( | char * | path, |
| const char * | extensions[] ) |
Check if a file has one of the specified extensions.
Checks if the file at the given path has one of the specified extensions.
| path | The path to the file. |
| extensions | An array of extensions to check (NULL-terminated). |
| bool directory_exists | ( | char * | path | ) |
Check if a directory exists at the given path.
Checks if a directory exists at the specified path.
| path | The path to the directory. |
| bool directory_create | ( | char * | path | ) |
Create a directory at the given path.
Creates a directory at the specified path, including any necessary parent directories.
| path | The path to the directory. |