/// @file VfsNs.cpp
/// @brief VFS namespace.
/// @author Alejandro Álvarez Ayllón <aalvarez@cern.ch>
+#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <dmlite/cpp/dmlite.h>
void VfsCatalog::create(const std::string& path, mode_t mode) throw (DmException)
{
- throw DmException(EACCES, "Write mode not supported");
+ FILE *f;
+
+ wrapCall(f = fopen(path.c_str(), "w"));
+ wrapCall(fclose(f));
+
+ setMode(path, mode);
}
void VfsCatalog::setMode(const std::string& path, mode_t mode) throw (DmException)
{
- throw DmException(EACCES, "Write mode not supported");
+ wrapCall(chmod(path.c_str(), mode));
}
void VfsCatalog::setOwner(const std::string& path, uid_t newUid, gid_t newGid, bool followSymLink) throw (DmException)
{
- throw DmException(EACCES, "Write mode not supported");
+ vfsThrow(ENOSYS, "changing owner not supported");
}