From 10c3a3af951bc913cf2f8c6434b0f5d0784618c9 Mon Sep 17 00:00:00 2001 From: Jeffrey Date: Thu, 10 Feb 2022 18:41:29 -0600 Subject: [PATCH] Removed unused functions from file_io_utils I removed three unused functions: `get_file_time`, `set_file_time`, and `append_string_to_file`. I have recompiled on Ubuntu 20 with no issues. --- contrib/epee/include/file_io_utils.h | 3 -- contrib/epee/src/file_io_utils.cpp | 43 ---------------------------- 2 files changed, 46 deletions(-) diff --git a/contrib/epee/include/file_io_utils.h b/contrib/epee/include/file_io_utils.h index 84dc79266..da05520c1 100644 --- a/contrib/epee/include/file_io_utils.h +++ b/contrib/epee/include/file_io_utils.h @@ -36,10 +36,7 @@ namespace file_io_utils { bool is_file_exist(const std::string& path); bool save_string_to_file(const std::string& path_to_file, const std::string& str); - bool get_file_time(const std::string& path_to_file, time_t& ft); - bool set_file_time(const std::string& path_to_file, const time_t& ft); bool load_file_to_string(const std::string& path_to_file, std::string& target_str, size_t max_size = 1000000000); - bool append_string_to_file(const std::string& path_to_file, const std::string& str); bool get_file_size(const std::string& path_to_file, uint64_t &size); } } diff --git a/contrib/epee/src/file_io_utils.cpp b/contrib/epee/src/file_io_utils.cpp index 5072adcbc..a8348431c 100644 --- a/contrib/epee/src/file_io_utils.cpp +++ b/contrib/epee/src/file_io_utils.cpp @@ -102,29 +102,6 @@ namespace file_io_utils } - bool get_file_time(const std::string& path_to_file, time_t& ft) - { - boost::system::error_code ec; - ft = boost::filesystem::last_write_time(boost::filesystem::path(path_to_file), ec); - if(!ec) - return true; - else - return false; - } - - - bool set_file_time(const std::string& path_to_file, const time_t& ft) - { - boost::system::error_code ec; - boost::filesystem::last_write_time(boost::filesystem::path(path_to_file), ft, ec); - if(!ec) - return true; - else - return false; - } - - - bool load_file_to_string(const std::string& path_to_file, std::string& target_str, size_t max_size) { #ifdef WIN32 @@ -174,26 +151,6 @@ namespace file_io_utils } - bool append_string_to_file(const std::string& path_to_file, const std::string& str) - { - // No special Windows implementation because so far not used in Monero code - try - { - std::ofstream fstream; - fstream.exceptions(std::ifstream::failbit | std::ifstream::badbit); - fstream.open(path_to_file.c_str(), std::ios_base::binary | std::ios_base::out | std::ios_base::app); - fstream << str; - fstream.close(); - return true; - } - - catch(...) - { - return false; - } - } - - bool get_file_size(const std::string& path_to_file, uint64_t &size) { #ifdef WIN32