|
@@ -129,6 +129,17 @@ static bool totp_open_config_file(Storage* storage, FlipperFormat** file) {
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
|
|
+ if(storage_common_stat(storage, CONFIG_FILE_DIRECTORY_PATH, NULL) == FSE_NOT_EXIST) {
|
|
|
|
|
+ FURI_LOG_D(LOGGING_TAG, "Config file directory doesn't exist. Will create new");
|
|
|
|
|
+ if(!storage_simply_mkdir(storage, CONFIG_FILE_DIRECTORY_PATH)) {
|
|
|
|
|
+ FURI_LOG_E(
|
|
|
|
|
+ LOGGING_TAG,
|
|
|
|
|
+ "Error creating config file directory %s",
|
|
|
|
|
+ CONFIG_FILE_DIRECTORY_PATH);
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
FURI_LOG_D(LOGGING_TAG, "Config file %s is not found. Will create new.", CONFIG_FILE_PATH);
|
|
FURI_LOG_D(LOGGING_TAG, "Config file %s is not found. Will create new.", CONFIG_FILE_PATH);
|
|
|
|
|
|
|
|
if(!flipper_format_file_open_new(fff_data_file, CONFIG_FILE_PATH)) {
|
|
if(!flipper_format_file_open_new(fff_data_file, CONFIG_FILE_PATH)) {
|