![]() |
Bitcoin Core
25.99.0
P2P Digital Currency
|
Go to the source code of this file.
Functions | |
bool | FileCommit (FILE *file) |
Ensure file contents are fully committed to disk, using a platform-specific feature analogous to fsync(). More... | |
void | DirectoryCommit (const fs::path &dirname) |
Sync directory contents. More... | |
bool | TruncateFile (FILE *file, unsigned int length) |
int | RaiseFileDescriptorLimit (int nMinFD) |
this function tries to raise the file descriptor limit to the requested number. More... | |
void | AllocateFileRange (FILE *file, unsigned int offset, unsigned int length) |
this function tries to make a particular range of a file allocated (corresponding to disk space) it is advisory, and the range specified in the arguments will never contain live data More... | |
bool | RenameOver (fs::path src, fs::path dest) |
Rename src to dest. More... | |
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) |
std::streampos | GetFileSize (const char *path, std::streamsize max=std::numeric_limits< std::streamsize >::max()) |
Get the size of a file by scanning it. More... | |
void | ReleaseDirectoryLocks () |
Release all directory locks. More... | |
bool | TryCreateDirectories (const fs::path &p) |
Ignores exceptions thrown by create_directories if the requested directory exists. More... | |
fs::path | GetDefaultDataDir () |
void AllocateFileRange | ( | FILE * | file, |
unsigned int | offset, | ||
unsigned int | length | ||
) |
this function tries to make a particular range of a file allocated (corresponding to disk space) it is advisory, and the range specified in the arguments will never contain live data
Definition at line 200 of file fs_helpers.cpp.
bool CheckDiskSpace | ( | const fs::path & | dir, |
uint64_t | additional_bytes = 0 |
||
) |
void DirectoryCommit | ( | const fs::path & | dirname | ) |
Sync directory contents.
This is required on some environments to ensure that newly created files are committed to disk.
Definition at line 152 of file fs_helpers.cpp.
bool DirIsWritable | ( | const fs::path & | directory | ) |
Definition at line 93 of file fs_helpers.cpp.
bool FileCommit | ( | FILE * | file | ) |
Ensure file contents are fully committed to disk, using a platform-specific feature analogous to fsync().
Definition at line 121 of file fs_helpers.cpp.
fs::path GetDefaultDataDir | ( | ) |
std::streampos GetFileSize | ( | const char * | path, |
std::streamsize | max = std::numeric_limits< std::streamsize >::max() |
||
) |
Get the size of a file by scanning it.
[in] | path | The file path |
[in] | max | Stop seeking beyond this limit |
Definition at line 114 of file fs_helpers.cpp.
bool LockDirectory | ( | const fs::path & | directory, |
const fs::path & | lockfile_name, | ||
bool | probe_only = false |
||
) |
Definition at line 57 of file fs_helpers.cpp.
int RaiseFileDescriptorLimit | ( | int | nMinFD | ) |
this function tries to raise the file descriptor limit to the requested number.
It returns the actual file descriptor limit (which may be more or less than nMinFD)
Definition at line 176 of file fs_helpers.cpp.
void ReleaseDirectoryLocks | ( | ) |
Release all directory locks.
This is used for unit testing only, at runtime the global destructor will take care of the locks.
Definition at line 87 of file fs_helpers.cpp.
Rename src to dest.
Definition at line 262 of file fs_helpers.cpp.
bool TruncateFile | ( | FILE * | file, |
unsigned int | length | ||
) |
bool TryCreateDirectories | ( | const fs::path & | p | ) |
Ignores exceptions thrown by create_directories if the requested directory exists.
Specifically handles case where path p exists, but it wasn't possible for the user to write to the parent directory.
Definition at line 285 of file fs_helpers.cpp.
Definition at line 81 of file fs_helpers.cpp.