if (errno == ENOENT) {
// throw exeption up only if there was not requested test for existence (F_OK)
if (mode & F_OK) return false;
- else vfsThrowErrno("stat() failed on '" + path + "' (stat)");
+ else vfsThrow(DMLITE_NO_SUCH_REPLICA, "stat() failed on '" + path + "': " + strerror(errno));
} else
- vfsThrowErrno("stat() failed on '" + path + "' (stat)");
+ vfsThrowErrno("stat() failed on '" + path + "'");
}
if (::access(path.c_str(), mode) == -1) {
}
+bool VfsCatalog::accessReplica(const std::string& replica, int mode) throw (DmException)
+{
+ return access(replica, mode);
+}
+
void VfsCatalog::addReplica(const Replica& replica) throw (DmException)
{
- throw DmException(EACCES, "Write mode not supported");
+ vfsThrow(EACCES, "write mode not supported");
}
void VfsCatalog::deleteReplica(const Replica& replica) throw (DmException)
{
- throw DmException(EACCES, "Write mode not supported");
+ vfsThrow(EACCES, "write mode not supported");
}
void VfsCatalog::updateReplica(const Replica& replica) throw (DmException)
{
- throw DmException(EACCES, "Write mode not supported");
+ // Nothing
}
ExtendedStat extendedStat(const std::string&, bool) throw (DmException);
bool access(const std::string& path, int mode) throw (DmException);
+ bool accessReplica(const std::string& replica, int mode) throw (DmException);
SymLink readLink(ino_t) throw (DmException);