MCPcopy Create free account
hub / github.com/chrxh/alien / hasWriteAccess

Function hasWriteAccess

source/PersisterInterface/SavepointTableService.cpp:14–26  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12namespace
13{
14 bool hasWriteAccess(std::filesystem::path const& path)
15 {
16 std::filesystem::path tempFilePath = path / "temp_test_file.tmp";
17
18 std::ofstream testFile(tempFilePath);
19 if (testFile) {
20 testFile.close();
21 std::filesystem::remove(tempFilePath);
22 return true;
23 } else {
24 return false;
25 }
26 }
27}
28
29auto SavepointTableService::loadFromFile(std::string const& filename) -> std::variant<SavepointTable, Error>

Callers 1

loadFromFileMethod · 0.85

Calls 1

closeMethod · 0.80

Tested by

no test coverage detected