From: František Dvořák Date: Mon, 2 Dec 2013 12:58:36 +0000 (+0100) Subject: Properly truncate the file on re-create (using xattr with size instead of truncate()). X-Git-Url: http://scientific.zcu.cz/git/?a=commitdiff_plain;h=140c0e189880c4e7afb218b10536921a0a97fdf3;p=dmlite-plugins-vfs.git Properly truncate the file on re-create (using xattr with size instead of truncate()). --- diff --git a/src/VfsNs.cpp b/src/VfsNs.cpp index 6e5f8a2..fe05072 100644 --- a/src/VfsNs.cpp +++ b/src/VfsNs.cpp @@ -702,8 +702,8 @@ void VfsCatalog::create(const std::string& path, mode_t mode) throw (DmException for (it = file.begin(); it != file.end() && it->first.compare(0, VFS_XATTR_LENGTH + 8, VFS_XATTR "replica.") != 0; it++); if (it != file.end()) vfsThrow(EACCES, "can't truncate '%s' with replicas", path.c_str()); - // FIXME: setSize() - wrapCall(truncate(lpath.c_str(), 0)); + // setSize(path, 0) + vfsSetXattr(path, lpath, VFS_XATTR "size", "0", 0); } }