50 KB_API b8 filesystem_size(
file_handle *file, usize *size);
54 KB_API b8 filesystem_read(
file_handle *file, usize size,
void *out, usize *bytes_read);
56 KB_API b8 filesystem_read_line(
file_handle *file, usize max_size,
char *out, usize *chars_read);
58 KB_API b8 filesystem_read_all(
file_handle *file, usize max_size,
void *out, usize *bytes_read);
60 KB_API b8 filesystem_read_all_text(
file_handle *file, usize max_size,
char *out, usize *chars_read);
62 KB_API b8 filesystem_write(
file_handle *file, usize size,
const void *data, usize *bytes_written);
64 KB_API b8 filesystem_write_line(
file_handle *file, usize size,
const char *data, usize *chars_written);
Global typedefs and macros.
file_modes
The modes a file can be opened in.
@ FILE_MODE_WRITE
Needed to be able to write to a file.
@ FILE_MODE_READ
Needed to be able to read from a file.
@ FILE_MODE_APPEND
Needed if the file should not be truncated when opened for writing.
struct file_handle file_handle
Handle for a file.
KB_API b8 filesystem_exists(const char *path)
Check if a given path exists.
b8 is_valid
Indicates if the file handle is valid.
file_modes modes
Contains the modes that were used to open the file.
b8 binary
Indicates if the file was opened in binary mode as opposed to text mode.
void * handle
Platform specific handle to the actual file.