From d7118ddf88418f6ad21bb19afd0e6846a184eba2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Franti=C5=A1ek=20Dvo=C5=99=C3=A1k?= Date: Wed, 9 Oct 2013 14:05:57 +0200 Subject: [PATCH] Catalog symlink(), unlink(), mkdir(), rename((), removeDir() implementations. --- src/VfsNs.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) 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())); } -- 1.8.2.3