#include <stdint-gcc.h>
Go to the source code of this file.
|
int | fopen (const char *filename, const char *mode) |
| Opens file.
|
|
int | fread (void *ptr, uint32_t size, uint32_t nmemb, int fd) |
| Reads from file.
|
|
int | fwrite (void *ptr, uint32_t size, uint32_t nmemb, int fd) |
| Writes to file.
|
|
int | fstat (int fd, struct file_stat *stat) |
| Returns file status.
|
|
int | fseek (int fd, int offset, FILE_SEEK_MODE whence) |
| Seeks into file.
|
|
int | fclose (int fd) |
| Closes file descriptor.
|
|
◆ FILE_MODE
◆ FILE_SEEK_MODE
◆ FILE_STAT_FLAGS
◆ FILE_OPEN_MODES
Enumerator |
---|
FILE_MODE_READ | |
FILE_MODE_WRITE | |
FILE_MODE_APPEND | |
FILE_MODE_INVALID | |
◆ FILE_SEEK_MODES
Enumerator |
---|
SEEK_SET | Absolute position from 0.
|
SEEK_CUR | Relative position.
|
SEEK_END | Absolute position from the end of file.
|
◆ FILE_STAT_FLAGS_ENUM
Enumerator |
---|
FILE_STAT_READ_ONLY | |
FILE_STAT_FOLDER | |
◆ fclose()
◆ fopen()
int fopen |
( |
const char * |
filename, |
|
|
const char * |
str_mode |
|
) |
| |
Opens file.
- Parameters
-
filename | File to open |
str_mode | Open mode |
- Returns
- int Status
References assert, mounted_file::data, data, EINVARG, FILE_MODE_INVALID, filename, file_descriptor::filesystem, mounted_file::fs, file_descriptor::index, kfree(), kzalloc(), MAX_MOUNTED, MAX_PATH, memset(), mounted, path_part::next, filesystem::open, path_part::part, pathparser_free(), pathparser_parse(), file_descriptor::private_fs, file_descriptor::private_fs_descriptor, strcmp(), strcpy(), and strlen().
◆ fread()
int fread |
( |
void * |
ptr, |
|
|
uint32_t |
size, |
|
|
uint32_t |
nmemb, |
|
|
int |
fd |
|
) |
| |
◆ fseek()
◆ fstat()
int fstat |
( |
int |
fd, |
|
|
struct file_stat * |
stat |
|
) |
| |
◆ fwrite()
int fwrite |
( |
void * |
ptr, |
|
|
uint32_t |
size, |
|
|
uint32_t |
nmemb, |
|
|
int |
fd |
|
) |
| |