MicrOS
|
#include "micros_filesystem.h"
Functions | |
bool | micros_filesystem_get_file_info (const char *path, micros_filesystem_file_info *file_info) |
Gets information about the file with path specified in parameter. More... | |
bool | micros_filesystem_get_directory_info (const char *path, micros_filesystem_directory_info *directory_info) |
Gets information about the directory with path specified in parameter. More... | |
bool | micros_filesystem_read_file (const char *path, uint8_t *buffer, const uint32_t start_index, const uint32_t length) |
Reads content from the file. More... | |
uint32_t | micros_filesystem_get_entries_count_in_directory (const char *path) |
Gets entries count in the directory. More... | |
bool | micros_filesystem_get_entries_in_directory (const char *path, char **entries) |
Gets pathes of the entries in the directory. More... | |
bool | micros_filesystem_is_file (const char *path) |
Check if the specified entry is a file. More... | |
bool | micros_filesystem_is_directory (const char *path) |
Check if the specified entry is a directory. More... | |
bool | micros_filesystem_create_file (const char *path) |
Creates file. More... | |
bool | micros_filesystem_create_directory (const char *path) |
Creates directory. More... | |
bool | micros_filesystem_delete_file (const char *path) |
Deletes file. More... | |
bool | micros_filesystem_delete_directory (const char *path) |
Deletes directory. More... | |
bool | micros_filesystem_rename_file (const char *path, const char *new_name) |
Renames file. More... | |
bool | micros_filesystem_rename_directory (const char *path, const char *new_name) |
Renames directory. More... | |
bool | micros_filesystem_save_to_file (const char *path, const char *buffer, const int size) |
Saves content stored in the buffer to the specified file. More... | |
bool | micros_filesystem_append_to_file (const char *path, const char *buffer, const int size) |
Appends content stored in the buffer to the end of the specified file. More... | |
bool | micros_filesystem_file_exists (const char *path) |
Checks if file with the specified path exists. More... | |
bool | micros_filesystem_directory_exists (const char *path) |
Checks if directory with the specified path exists. More... | |
int | micros_filesystem_get_free_space (const char partition_symbol) |
Gets free space on the specified partition. More... | |
int | micros_filesystem_get_total_space (const char partition_symbol) |
Gets total space on the specified partition. More... | |
bool micros_filesystem_append_to_file | ( | const char * | path, |
const char * | buffer, | ||
const int | size | ||
) |
Appends content stored in the buffer to the end of the specified file.
Appends content stored in the buffer to the end of the specified file and returns flag indicating success.
path | Path to the file. |
buffer | Buffer with content to save. |
size | Buffer size. |
bool micros_filesystem_create_directory | ( | const char * | path | ) |
Creates directory.
Creates directory with the specified path.
path | Path to the new directory. |
bool micros_filesystem_create_file | ( | const char * | path | ) |
Creates file.
Creates file with the specified path.
path | Path to the new file. |
bool micros_filesystem_delete_directory | ( | const char * | path | ) |
Deletes directory.
Deletes directory with the specified path.
path | Path to the directory. |
bool micros_filesystem_delete_file | ( | const char * | path | ) |
Deletes file.
Deletes file with the specified path.
path | Path to the file. |
bool micros_filesystem_directory_exists | ( | const char * | path | ) |
Checks if directory with the specified path exists.
Checks if directory with the specified path exists and returns corresponding flag
path | Path to the directory. |
bool micros_filesystem_file_exists | ( | const char * | path | ) |
Checks if file with the specified path exists.
Checks if file with the specified path exists and returns corresponding flag
path | Path to the file. |
bool micros_filesystem_get_directory_info | ( | const char * | path, |
micros_filesystem_directory_info * | directory_info | ||
) |
Gets information about the directory with path specified in parameter.
Gets information about the directory with path specified in parameter and fills structure.
path | Path to the directory. |
directory_info | Structure which will be filled. |
uint32_t micros_filesystem_get_entries_count_in_directory | ( | const char * | path | ) |
Gets entries count in the directory.
Gets entries count (files and directories) in the directory.
path | Path to the directory. |
bool micros_filesystem_get_entries_in_directory | ( | const char * | path, |
char ** | entries | ||
) |
Gets pathes of the entries in the directory.
Gets pathes of the entries in the directory and stores them in the passed buffer.
path | Path to the directory. |
entries | Buffer where the pathes will be stored. |
bool micros_filesystem_get_file_info | ( | const char * | path, |
micros_filesystem_file_info * | file_info | ||
) |
Gets information about the file with path specified in parameter.
Gets information about the file with path specified in parameter and fills structure.
path | Path to the file. |
file_info | Structure which will be filled. |
int micros_filesystem_get_free_space | ( | const char | partition_symbol | ) |
Gets free space on the specified partition.
Gets free space on the specified partition (in bytes).
partition_symbol | Partition symbol. |
int micros_filesystem_get_total_space | ( | const char | partition_symbol | ) |
Gets total space on the specified partition.
Gets total space on specified partition (in bytes).
partition_symbol | Partition symbol. |
bool micros_filesystem_is_directory | ( | const char * | path | ) |
Check if the specified entry is a directory.
Check if the specified entry is a directory and returns corresponding flag.
path | Path to the entry. |
bool micros_filesystem_is_file | ( | const char * | path | ) |
Check if the specified entry is a file.
Check if the specified entry is a file and returns corresponding flag.
path | Path to the entry. |
bool micros_filesystem_read_file | ( | const char * | path, |
uint8_t * | buffer, | ||
const uint32_t | start_index, | ||
const uint32_t | length | ||
) |
Reads content from the file.
Reads content from the file and stores data in the buffer passed in the parameter.
path | Path to the directory. |
buffer | Buffer where the read data will be stored. Size must be equal or bigger than length. |
start_index | Position where the reading will be started. |
length | Requested size of the read data. |
bool micros_filesystem_rename_directory | ( | const char * | path, |
const char * | new_name | ||
) |
Renames directory.
Renames directory with the specified path.
path | Path to the directory. |
new_name | New name of the directory (Without leading path). |
bool micros_filesystem_rename_file | ( | const char * | path, |
const char * | new_name | ||
) |
Renames file.
Renames file with the specified path.
path | Path to the file. |
new_name | New name of the file (Without leading path). |
bool micros_filesystem_save_to_file | ( | const char * | path, |
const char * | buffer, | ||
const int | size | ||
) |
Saves content stored in the buffer to the specified file.
Saves content stored in the buffer to the specified file and returns flag indicating success. If file is not empty, then old data is overwrited.
path | Path to the file. |
buffer | Buffer with content to save. |
size | Buffer size. |