[FL-2423] Storage: blocking dir open (#1083)

* Storage: more unit tests
* Storage: blocking dir open, differentiate file and dir when freed.

Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
SG
2022-04-04 22:27:48 +10:00
committed by GitHub
parent 88cb90783d
commit e5a1f20fd4
4 changed files with 138 additions and 6 deletions

View File

@@ -24,6 +24,7 @@ typedef enum {
StorageEventTypeCardUnmount,
StorageEventTypeCardMountError,
StorageEventTypeFileClose,
StorageEventTypeDirClose,
} StorageEventType;
typedef struct {
@@ -65,6 +66,12 @@ bool storage_file_close(File* file);
*/
bool storage_file_is_open(File* file);
/** Tells if the file is a directory
* @param file pointer to a file object
* @return bool true if file is a directory
*/
bool storage_file_is_dir(File* file);
/** Reads bytes from a file into a buffer
* @param file pointer to file object.
* @param buff pointer to a buffer, for reading