From: František Dvořák Date: Wed, 10 Jul 2013 11:43:17 +0000 (+0200) Subject: Catalog create(), setMode() implementation, setOwner() not supported. X-Git-Url: http://scientific.zcu.cz/git/?a=commitdiff_plain;h=f3cb21e1aab1e206baf69ef72ceb4a62d5983993;p=dmlite-plugins-vfs-old.git Catalog create(), setMode() implementation, setOwner() not supported. --- diff --git a/src/VfsNs.cpp b/src/VfsNs.cpp index 8ac10c5..a11d958 100644 --- a/src/VfsNs.cpp +++ b/src/VfsNs.cpp @@ -1,6 +1,7 @@ /// @file VfsNs.cpp /// @brief VFS namespace. /// @author Alejandro Álvarez Ayllón +#include #include #include #include @@ -182,7 +183,12 @@ void VfsCatalog::unlink(const std::string& path) throw (DmException) 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); } @@ -196,14 +202,14 @@ mode_t VfsCatalog::umask(mode_t mask) throw () 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"); }