N64FlashcartMenu
Loading...
Searching...
No Matches
fs.h
Go to the documentation of this file.
1#ifndef UTILS_FS_H__
2#define UTILS_FS_H__
3
4#include <stdbool.h>
5#include <stddef.h>
6#include <stdint.h>
7
12#define FS_SECTOR_SIZE (512)
13
28char *strip_fs_prefix(char *path);
29
38char *file_basename(char *path);
39
48bool file_exists(char *path);
49
58int64_t file_get_size(char *path);
59
69bool file_allocate(char *path, size_t size);
70
80bool file_fill(char *path, uint8_t value);
81
91bool file_has_extensions(char *path, const char *extensions[]);
92
101bool directory_exists(char *path);
102
111bool directory_create(char *path);
112
113#endif // UTILS_FS_H__
bool file_exists(char *path)
Check if a file exists at the given path.
Definition fs.c:54
int64_t file_get_size(char *path)
Get the size of a file at the given path.
Definition fs.c:68
bool file_fill(char *path, uint8_t value)
Fill a file with the specified value.
Definition fs.c:113
bool file_has_extensions(char *path, const char *extensions[])
Check if a file has one of the specified extensions.
Definition fs.c:157
bool directory_create(char *path)
Create a directory at the given path.
Definition fs.c:196
bool file_allocate(char *path, size_t size)
Allocate a file of the specified size at the given path.
Definition fs.c:85
bool directory_exists(char *path)
Check if a directory exists at the given path.
Definition fs.c:182
char * strip_fs_prefix(char *path)
Strip the file system prefix from a path.
Definition fs.c:24
char * file_basename(char *path)
Get the basename of a path.
Definition fs.c:41