 |
Belle II Software
release-05-01-25
|
42 static std::string
findFile(
const std::string& path,
bool silent =
false);
65 static std::string
findFile(
const std::string& path,
const std::string& dataType,
bool silent =
false);
68 static bool fileExists(
const std::string& filename);
72 static bool isFile(
const std::string& filename);
74 static bool isDir(
const std::string& filename);
76 static bool isSymLink(
const std::string& filename);
79 static std::string
calculateMD5(
const std::string& filename);
94 static bool loadLibrary(std::string library,
bool fullname =
true);
107 explicit Lock(
const std::string& fileName,
bool readonly =
false);
122 bool lock(
int timeout = 300,
bool ignoreErrors =
false);
133 explicit TemporaryFile(std::ios_base::openmode mode = std::ios_base::trunc | std::ios_base::out);
156 static std::string
findFile(
const std::string& path,
const std::vector<std::string>& dirs,
bool silent);
std::string getName() const
get filename of the temporary file
bool lock(int timeout=300, bool ignoreErrors=false)
Try to lock the file.
static bool fileDirExists(const std::string &filename)
Check if the dir containing the filename exists.
static bool isFile(const std::string &filename)
Check if filename points to an existing file.
Lock(const std::string &fileName, bool readonly=false)
Construct a Lock object for the given file.
FileSystem()=delete
no instances.
~TemporaryFile()
close file and delete on destruction
TemporaryFile & operator=(const TemporaryFile &)=delete
prevent copy constructor
static std::string calculateMD5(const std::string &filename)
Calculate the MD5 checksum of a given file.
static bool loadLibrary(std::string library, bool fullname=true)
Load a shared library.
static bool isSymLink(const std::string &filename)
Check if filename points to an existing symbolic link.
static std::string calculateAdler32(const std::string &filename)
Calculate the Adler-32 checksum of a given file.
std::string m_filename
filename of the temporary file
Abstract base class for different kinds of events.
TemporaryFile(std::ios_base::openmode mode=std::ios_base::trunc|std::ios_base::out)
construct a new temporary file
Helper file to create a temporary file and ensure deletion if object goes out of scope.
bool m_readOnly
if this is a read-only lock (multiple processes can hold one).
static bool fileExists(const std::string &filename)
Check if the file with given filename exists.
static bool isDir(const std::string &filename)
Check if filename points to an existing directory.
int m_file
File descriptor of file to be locked.
static std::string findFile(const std::string &path, bool silent=false)
Search for given file or directory in local or central release directory, and return absolute path if...