From e00d91e1d247e9be13aa83e36cb4d6e2a8a27c02 Mon Sep 17 00:00:00 2001 From: notpike Date: Tue, 1 Feb 2022 10:37:38 -0800 Subject: [PATCH] Added return codes for delete_file() and rename_file() for file.hpp --- firmware/application/file.cpp | 8 ++++---- firmware/application/file.hpp | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/firmware/application/file.cpp b/firmware/application/file.cpp index a1f4b388..a16d1c98 100644 --- a/firmware/application/file.cpp +++ b/firmware/application/file.cpp @@ -197,12 +197,12 @@ std::vector scan_root_directories(const std::filesystem:: return directory_list; } -void delete_file(const std::filesystem::path& file_path) { - f_unlink(reinterpret_cast(file_path.c_str())); +uint32_t delete_file(const std::filesystem::path& file_path) { + return f_unlink(reinterpret_cast(file_path.c_str())); } -void rename_file(const std::filesystem::path& file_path, const std::filesystem::path& new_name) { - f_rename(reinterpret_cast(file_path.c_str()), reinterpret_cast(new_name.c_str())); +uint32_t rename_file(const std::filesystem::path& file_path, const std::filesystem::path& new_name) { + return f_rename(reinterpret_cast(file_path.c_str()), reinterpret_cast(new_name.c_str())); } FATTimestamp file_created_date(const std::filesystem::path& file_path) { diff --git a/firmware/application/file.hpp b/firmware/application/file.hpp index d68e3a9f..815c247b 100644 --- a/firmware/application/file.hpp +++ b/firmware/application/file.hpp @@ -238,8 +238,8 @@ struct FATTimestamp { uint16_t FAT_time; }; -void delete_file(const std::filesystem::path& file_path); -void rename_file(const std::filesystem::path& file_path, const std::filesystem::path& new_name); +uint32_t delete_file(const std::filesystem::path& file_path); +uint32_t rename_file(const std::filesystem::path& file_path, const std::filesystem::path& new_name); FATTimestamp file_created_date(const std::filesystem::path& file_path); uint32_t make_new_directory(const std::filesystem::path& dir_path);