From 100a7d06eee6d3f60a1c2d00af53e4665c5f5690 Mon Sep 17 00:00:00 2001 From: 0xFFFC0000 <0xFFFC0000@proton.me> Date: Mon, 22 Apr 2024 14:32:12 +0000 Subject: Add drop_and_recreate in privatefile class. When creating a private file we need to delete the file if exist. --- src/common/util.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/common/util.h') diff --git a/src/common/util.h b/src/common/util.h index f489594e8..35b897017 100644 --- a/src/common/util.h +++ b/src/common/util.h @@ -80,7 +80,11 @@ namespace tools /*! \return File only readable by owner and only used by this process OR `private_file{}` on error. */ - static private_file create(std::string filename); + static private_file create(std::string filename, uint32_t extra_flags = 0); + + /*! \return Drop and create file only readable by owner and only used + by this process OR `private_file{}` on error. */ + static private_file drop_and_recreate(std::string filename); private_file(private_file&&) = default; private_file& operator=(private_file&&) = default; -- cgit v1.2.3