aboutsummaryrefslogtreecommitdiff
path: root/src/util/system.h
diff options
context:
space:
mode:
authorBen Woosley <ben.woosley@gmail.com>2023-03-06 23:41:46 +0100
committerTheCharlatan <seb.kung@gmail.com>2023-03-23 12:52:00 +0100
commit18fb36367a28819bd5ab402344802796a1248979 (patch)
treef3b9230dd86440f68d1bad93040470e503f886f9 /src/util/system.h
parent40e1c4d4024b8ad35f2511b2e10bf80c5531dfde (diff)
downloadbitcoin-18fb36367a28819bd5ab402344802796a1248979.tar.xz
refactor: Extract util/fs_helpers from util/system
This is an extraction of filesystem related functions from util/system into their own utility file. The background of this commit is an ongoing effort to decouple the libbitcoinkernel library from the ArgsManager defined in system.h. Moving these functions out of system.h allows including them from a separate source file without including the ArgsManager definitions from system.h.
Diffstat (limited to 'src/util/system.h')
-rw-r--r--src/util/system.h46
1 files changed, 0 insertions, 46 deletions
diff --git a/src/util/system.h b/src/util/system.h
index 7292262bea..317ebd35fa 100644
--- a/src/util/system.h
+++ b/src/util/system.h
@@ -42,55 +42,9 @@ extern const char * const BITCOIN_SETTINGS_FILENAME;
void SetupEnvironment();
bool SetupNetworking();
-
-/**
- * Ensure file contents are fully committed to disk, using a platform-specific
- * feature analogous to fsync().
- */
-bool FileCommit(FILE *file);
-
-/**
- * Sync directory contents. This is required on some environments to ensure that
- * newly created files are committed to disk.
- */
-void DirectoryCommit(const fs::path &dirname);
-
-bool TruncateFile(FILE *file, unsigned int length);
-int RaiseFileDescriptorLimit(int nMinFD);
-void AllocateFileRange(FILE *file, unsigned int offset, unsigned int length);
-
-/**
- * Rename src to dest.
- * @return true if the rename was successful.
- */
-[[nodiscard]] bool RenameOver(fs::path src, fs::path dest);
-
-bool LockDirectory(const fs::path& directory, const fs::path& lockfile_name, bool probe_only=false);
-void UnlockDirectory(const fs::path& directory, const fs::path& lockfile_name);
-bool DirIsWritable(const fs::path& directory);
-bool CheckDiskSpace(const fs::path& dir, uint64_t additional_bytes = 0);
-
-/** Get the size of a file by scanning it.
- *
- * @param[in] path The file path
- * @param[in] max Stop seeking beyond this limit
- * @return The file size or max
- */
-std::streampos GetFileSize(const char* path, std::streamsize max = std::numeric_limits<std::streamsize>::max());
-
-/** Release all directory locks. This is used for unit testing only, at runtime
- * the global destructor will take care of the locks.
- */
-void ReleaseDirectoryLocks();
-
-bool TryCreateDirectories(const fs::path& p);
-fs::path GetDefaultDataDir();
// Return true if -datadir option points to a valid directory or is not specified.
bool CheckDataDirOption(const ArgsManager& args);
fs::path GetConfigFile(const ArgsManager& args, const fs::path& configuration_file_path);
-#ifdef WIN32
-fs::path GetSpecialFolderPath(int nFolder, bool fCreate = true);
-#endif
#ifndef WIN32
std::string ShellEscape(const std::string& arg);
#endif