MCPcopy Create free account
hub / github.com/duckdb/duckdb / TestFileGuard

Method TestFileGuard

test/common/test_caching_file_system_wrapper.cpp:23–28  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21class TestFileGuard {
22public:
23 TestFileGuard(const string &filename, const string &content) : file_path(TestCreatePath(filename)) {
24 auto local_fs = FileSystem::CreateLocal();
25 auto handle = local_fs->OpenFile(file_path, FileFlags::FILE_FLAGS_WRITE | FileFlags::FILE_FLAGS_FILE_CREATE);
26 handle->Write(QueryContext(), const_cast<char *>(content.data()), content.size(), 0);
27 handle->Sync();
28 }
29
30 ~TestFileGuard() {
31 auto local_fs = FileSystem::CreateLocal();

Callers

nothing calls this directly

Calls 7

TestCreatePathFunction · 0.85
QueryContextClass · 0.50
OpenFileMethod · 0.45
WriteMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45
SyncMethod · 0.45

Tested by

no test coverage detected