MicrOS
filesystem.h
Go to the documentation of this file.
1 #ifndef FILESYSTEM_H
2 #define FILESYSTEM_H
3 
4 #include <stdbool.h>
5 #include "fat/fat.h"
8 #include "klibrary/kvector.h"
11 #include "partitions/partitions.h"
12 
13 // This is the common entry point for all filesystems. Now it will support only FAT, so every
14 // method with fat_ prefix will be called directly. It will be changed in the future if there
15 // will be more supported file systems.
16 void filesystem_remove_partition_from_path(char *old_path, char *new_path);
17 bool filesystem_get_file_info(char *path, filesystem_file_info *file_info);
18 bool filesystem_get_directory_info(char *path, filesystem_directory_info *directory_info);
19 bool filesystem_read_file(char *path, uint8_t *buffer, uint32_t start_index, uint32_t length);
21 bool filesystem_get_entries_in_directory(char *path, char **entries);
22 bool filesystem_is_file(char *path);
23 bool filesystem_is_directory(char *path);
24 uint32_t filesystem_get_free_space(char partition_symbol);
25 uint32_t filesystem_get_total_space(char partition_symbol);
26 
27 bool filesystem_create_file(char *path);
28 bool filesystem_create_directory(char *path);
29 bool filesystem_delete_file(char *path);
30 bool filesystem_delete_directory(char *path);
31 bool filesystem_rename_file(char *path, char *new_name);
32 bool filesystem_rename_directory(char *path, char *new_name);
33 bool filesystem_save_to_file(char *path, char *buffer, int size);
34 bool filesystem_append_to_file(char *path, char *buffer, int size);
35 
36 void filesystem_remove_partition_from_path(char *old_path, char *new_path);
37 
38 #endif
Definition: filesystem_directory_info.h:6
bool filesystem_get_directory_info(char *path, filesystem_directory_info *directory_info)
Definition: filesystem.c:15
bool filesystem_save_to_file(char *path, char *buffer, int size)
Definition: filesystem.c:177
uint32_t filesystem_get_free_space(char partition_symbol)
Definition: filesystem.c:87
bool filesystem_is_directory(char *path)
Definition: filesystem.c:75
bool filesystem_rename_file(char *path, char *new_name)
Definition: filesystem.c:153
bool filesystem_get_file_info(char *path, filesystem_file_info *file_info)
Definition: filesystem.c:3
uint32_t filesystem_get_total_space(char partition_symbol)
Definition: filesystem.c:96
bool filesystem_delete_directory(char *path)
Definition: filesystem.c:141
bool filesystem_is_file(char *path)
Definition: filesystem.c:63
bool filesystem_create_file(char *path)
Definition: filesystem.c:105
bool filesystem_rename_directory(char *path, char *new_name)
Definition: filesystem.c:165
bool filesystem_append_to_file(char *path, char *buffer, int size)
Definition: filesystem.c:189
bool filesystem_create_directory(char *path)
Definition: filesystem.c:117
char buffer[500]
Definition: physical_memory_manager.c:5
uint32_t filesystem_get_entries_count_in_directory(char *path)
Definition: filesystem.c:39
Definition: filesystem_file_info.h:7
bool filesystem_delete_file(char *path)
Definition: filesystem.c:129
bool filesystem_get_entries_in_directory(char *path, char **entries)
Definition: filesystem.c:51
bool filesystem_read_file(char *path, uint8_t *buffer, uint32_t start_index, uint32_t length)
Definition: filesystem.c:27
size_t uint32_t
Unsigned integral type.
Definition: string.h:8
void filesystem_remove_partition_from_path(char *old_path, char *new_path)
Definition: filesystem.c:201