Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/ClusterM/flipperzero-firmware.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSG <who.just.the.doctor@gmail.com>2021-10-06 12:40:28 +0300
committerGitHub <noreply@github.com>2021-10-06 12:40:28 +0300
commitc8b36dd406e325263df280941d5da1623f96305b (patch)
treec6a8f08d10579767a9acf181ce7155b118e4aa4f /applications/storage
parente0c1928fde94387f0fc819eda16004c68ce164a6 (diff)
[FL-1791] Flipper file format (#740)
* Lib: new flipper file format library * Lib: flipper file format cpp wrapper * Storage: simple function for remove file and check error * iButton app: remove file worker, use new flipper file format instead * Dialogs: storage error message * Storage: simple function for mkdir and check error * iButton app: error messages * Libs: update makefile * RFID app: remove file worker, use new flipper file format instead * Flipper File: library documentation Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
Diffstat (limited to 'applications/storage')
-rw-r--r--applications/storage/storage-external-api.c12
-rw-r--r--applications/storage/storage.h18
2 files changed, 30 insertions, 0 deletions
diff --git a/applications/storage/storage-external-api.c b/applications/storage/storage-external-api.c
index 7063d182..aa11161e 100644
--- a/applications/storage/storage-external-api.c
+++ b/applications/storage/storage-external-api.c
@@ -380,4 +380,16 @@ void storage_file_free(File* file) {
}
free(file);
+}
+
+bool storage_simply_remove(Storage* storage, const char* path) {
+ FS_Error result;
+ result = storage_common_remove(storage, path);
+ return result == FSE_OK || result == FSE_NOT_EXIST;
+}
+
+bool storage_simply_mkdir(Storage* storage, const char* path) {
+ FS_Error result;
+ result = storage_common_mkdir(storage, path);
+ return result == FSE_OK || result == FSE_EXIST;
} \ No newline at end of file
diff --git a/applications/storage/storage.h b/applications/storage/storage.h
index 50e70b84..d38153bf 100644
--- a/applications/storage/storage.h
+++ b/applications/storage/storage.h
@@ -230,6 +230,24 @@ FS_Error storage_sd_info(Storage* api, SDInfo* info);
*/
FS_Error storage_sd_status(Storage* api);
+/***************** Simplified Functions ******************/
+
+/**
+ * Removes a file/directory from the repository, the directory must be empty and the file/directory must not be open
+ * @param storage pointer to the api
+ * @param path
+ * @return true on success or if file/dir is not exist
+ */
+bool storage_simply_remove(Storage* storage, const char* path);
+
+/**
+ * Creates a directory
+ * @param storage
+ * @param path
+ * @return true on success or if directory is already exist
+ */
+bool storage_simply_mkdir(Storage* storage, const char* path);
+
#ifdef __cplusplus
}
#endif \ No newline at end of file