#include <inputHandlerDaosFs.h>
Definition at line 15 of file inputHandlerDaosFs.h.
◆ daosFs()
inputHandler::daosFs::daosFs |
( |
| ) |
|
◆ ~daosFs()
inputHandler::daosFs::~daosFs |
( |
| ) |
|
|
overridedefault |
◆ getDirectory()
std::unique_ptr< base::Directory > inputHandler::daosFs::getDirectory |
( |
const std::string & |
path | ) |
|
|
overridevirtual |
◆ newReader()
get a reader for the file at path
- Returns
- unique ptr to a file reader.
- Exceptions
-
std::system_error | if file can't be opened File will be closed when the pointer goes out of scope. |
- Parameters
-
[in] | path | [in] path to the file to be opened for reading |
[in,out] | state | [in,out] state may be set to vanished if the file does not exist |
[in] | inititalStat | [in] genericStat data of the file encountered before reading, needed for checking unchangedness at the end |
Implements inputHandler::base.
Definition at line 21 of file inputHandlerDaosFs.cpp.
24 return std::unique_ptr<base::reader>(
new readerDaosFs(aPath,
◆ readLinkTarget()
bool inputHandler::daosFs::readLinkTarget |
( |
const std::string & |
, |
|
|
std::vector< char > & |
|
|
) |
| |
|
overridevirtual |
read link target from a symlink
- Parameters
-
[in] | path | is the path to the link |
[in,out] | target | is a vector that the link target gets written into, must be large enough |
- Returns
- true if link could be read, false if the link does not exist
- Exceptions
-
std::system_error | if the link could not be read |
std::runtime_error | if the target size is larger than target.size() |
Reimplemented from inputHandler::base.
Definition at line 31 of file inputHandlerDaosFs.cpp.
34 auto linklength = readlink(path.c_str(), target.data(), target.size());
35 if (linklength == -1 && errno == ENOENT) {
39 if (linklength >=
static_cast<ssize_t
>(target.size())) {
40 throw std::runtime_error(
"link size increased after stat for " + path);
42 target[linklength] =
'\0';
References throwcall::badval(), and timerInst.
◆ factory
The documentation for this class was generated from the following files:
T badval(T call, t badvalue, const Args &... args)
template function to wrap system calls that return a special bad value on failure