mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-04-24 03:29:57 -07:00
[FL-3662] Do not remove file when renaming to itself (#3193)
* Do not allow overwriting a file with dir and support renaming file to itself * Fix operator precedence error * Add support for storage-specific path equivalence checks * Fix typo * Fix updater compilation * Update Doxygen comments in storage.h Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
This commit is contained in:
@@ -165,6 +165,13 @@ typedef struct {
|
||||
* @param total_space pointer to total space value
|
||||
* @param free_space pointer to free space value
|
||||
* @return FS_Error error info
|
||||
*
|
||||
* @var FS_Common_Api::equivalent_path
|
||||
* @brief Test whether two paths are equivalent (e.g differing case on a case-insensitive fs)
|
||||
* @param path1 first path to be compared
|
||||
* @param path2 second path to be compared
|
||||
* @param truncate if set to true, compare only up to the path1's length
|
||||
* @return true if path1 and path2 are considered equivalent
|
||||
*/
|
||||
typedef struct {
|
||||
FS_Error (*const stat)(void* context, const char* path, FileInfo* fileinfo);
|
||||
@@ -175,6 +182,7 @@ typedef struct {
|
||||
const char* fs_path,
|
||||
uint64_t* total_space,
|
||||
uint64_t* free_space);
|
||||
bool (*const equivalent_path)(const char* path1, const char* path2);
|
||||
} FS_Common_Api;
|
||||
|
||||
/** Full filesystem api structure */
|
||||
|
||||
Reference in New Issue
Block a user