From: František Dvořák Date: Wed, 9 Oct 2013 12:05:57 +0000 (+0200) Subject: Catalog symlink(), unlink(), mkdir(), rename((), removeDir() implementations. X-Git-Url: http://scientific.zcu.cz/git/?a=commitdiff_plain;h=d7118ddf88418f6ad21bb19afd0e6846a184eba2;p=dmlite-plugins-vfs.git Catalog symlink(), unlink(), mkdir(), rename((), removeDir() implementations. --- diff --git a/src/VfsNs.cpp b/src/VfsNs.cpp index b1787ac..50106c9 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 @@ -162,7 +163,7 @@ std::vector VfsCatalog::getReplicas(const std::string& path) throw (DmE 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())); } @@ -178,7 +179,7 @@ std::string VfsCatalog::readLink(const std::string& path) throw (DmException) void VfsCatalog::unlink(const std::string& path) throw (DmException) { - throw DmException(EACCES, "Write mode not supported"); + wrapCall(::unlink(path.c_str())); } @@ -351,21 +352,21 @@ ExtendedStat* VfsCatalog::readDirx(Directory* dir) throw (DmException) 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())); }