This commit is contained in:
Sebastian Messmer 2014-11-12 12:43:49 +01:00
parent b85da9a688
commit e3259d68f9

View File

@ -111,20 +111,22 @@ int CryFuse::rmdir(const path &path) {
//TODO //TODO
int CryFuse::symlink(const path &from, const path &to) { int CryFuse::symlink(const path &from, const path &to) {
//printf("symlink(%s, %s)\n", from.c_str(), to.c_str()); printf("NOT IMPLEMENTED: symlink(%s, %s)\n", from.c_str(), to.c_str());
auto real_from = _device->RootDir() / from; //auto real_from = _device->RootDir() / from;
auto real_to = _device->RootDir() / to; //auto real_to = _device->RootDir() / to;
int retstat = ::symlink(real_from.c_str(), real_to.c_str()); //int retstat = ::symlink(real_from.c_str(), real_to.c_str());
return errcode_map(retstat); //return errcode_map(retstat);
return EIO; //TODO Correct return value
} }
//TODO
int CryFuse::rename(const path &from, const path &to) { int CryFuse::rename(const path &from, const path &to) {
//printf("rename(%s, %s)\n", from.c_str(), to.c_str()); //printf("rename(%s, %s)\n", from.c_str(), to.c_str());
auto real_from = _device->RootDir() / from; try {
auto real_to = _device->RootDir() / to; _device->rename(from, to);
int retstat = ::rename(real_from.c_str(), real_to.c_str()); return 0;
return errcode_map(retstat); } catch(cryfs::CryErrnoException &e) {
return -e.getErrno();
}
} }
//TODO //TODO