/// @file VfsNs.cpp
/// @brief VFS namespace.
/// @author Alejandro Álvarez Ayllón <aalvarez@cern.ch>
+#include <sys/stat.h>
#include <sys/types.h>
#include <utime.h>
#include <cstdio>
void VfsCatalog::symlink(const std::string& oldpath, const std::string& newpath) throw (DmException)
{
- throw DmException(EACCES, "Write mode not supported");
+ wrapCall(::symlink(oldpath.c_str(), newpath.c_str()));
}
void VfsCatalog::unlink(const std::string& path) throw (DmException)
{
- throw DmException(EACCES, "Write mode not supported");
+ wrapCall(::unlink(path.c_str()));
}
void VfsCatalog::makeDir(const std::string& path, mode_t mode) throw (DmException)
{
- throw DmException(EACCES, "Write mode not supported");
+ wrapCall(mkdir(path.c_str(), mode));
}
void VfsCatalog::rename(const std::string& oldPath, const std::string& newPath) throw (DmException)
{
- throw DmException(EACCES, "Write mode not supported");
+ wrapCall(::rename(oldPath.c_str(), newPath.c_str()));
}
void VfsCatalog::removeDir(const std::string& path) throw (DmException)
{
- throw DmException(EACCES, "Write mode not supported");
+ wrapCall(rmdir(path.c_str()));
}