aboutsummaryrefslogtreecommitdiff
path: root/zencore/include
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2022-05-28 00:29:17 +0200
committerDan Engelbrecht <[email protected]>2022-05-28 00:29:17 +0200
commitda0ca23fa55f7e900853bdfd06523b78fce32259 (patch)
tree8b2190cb5341d01fcd9efa9026b1b14f227123bc /zencore/include
parentHorde execute compressed input blobs (#109) (diff)
downloadzen-da0ca23fa55f7e900853bdfd06523b78fce32259.tar.xz
zen-da0ca23fa55f7e900853bdfd06523b78fce32259.zip
Enable FILE_SHARE_DELETE on standalone files in disk buckets
This allows us to delete the file even if it is open for read. We do a delete, the rename since we are not allowed to do a rename-overwrite, only delete. As we have the shard lock for the file we want to replace we can safely do a delete+rename. In the rare case that we fail to rename the file into place the old data is lost. As this is a *cache* and it should be very rare this is OK.
Diffstat (limited to 'zencore/include')
-rw-r--r--zencore/include/zencore/iobuffer.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/zencore/include/zencore/iobuffer.h b/zencore/include/zencore/iobuffer.h
index 5d9daa1c7..bf658922d 100644
--- a/zencore/include/zencore/iobuffer.h
+++ b/zencore/include/zencore/iobuffer.h
@@ -403,6 +403,7 @@ class IoBufferBuilder
{
public:
ZENCORE_API static IoBuffer MakeFromFile(const std::filesystem::path& FileName, uint64_t Offset = 0, uint64_t Size = ~0ull);
+ ZENCORE_API static IoBuffer MakeFromFileWithSharedDelete(const std::filesystem::path& FileName);
ZENCORE_API static IoBuffer MakeFromTemporaryFile(const std::filesystem::path& FileName);
ZENCORE_API static IoBuffer MakeFromFileHandle(void* FileHandle, uint64_t Offset = 0, uint64_t Size = ~0ull);
ZENCORE_API static IoBuffer ReadFromFileMaybe(IoBuffer& InBuffer);