aboutsummaryrefslogtreecommitdiff
path: root/src/common/util.h
diff options
context:
space:
mode:
author0xFFFC0000 <0xFFFC0000@proton.me>2024-04-22 14:32:12 +0000
committer0xFFFC0000 <0xFFFC0000@proton.me>2024-04-23 11:52:45 +0330
commit100a7d06eee6d3f60a1c2d00af53e4665c5f5690 (patch)
treebfd9cdc698a876f8608c3bb4f68336563beea94b /src/common/util.h
parent81d4db08eb75ce5392c65ca6571e7b08e41b7c95 (diff)
downloadmonzero-core-100a7d06eee6d3f60a1c2d00af53e4665c5f5690.tar.gz
monzero-core-100a7d06eee6d3f60a1c2d00af53e4665c5f5690.tar.xz
monzero-core-100a7d06eee6d3f60a1c2d00af53e4665c5f5690.zip
Add drop_and_recreate in privatefile class.
When creating a private file we need to delete the file if exist.
Diffstat (limited to 'src/common/util.h')
-rw-r--r--src/common/util.h6
1 files changed, 5 insertions, 1 deletions
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;