MCPcopy Create free account
hub / github.com/ElementsProject/elements / NewSequentialFile

Method NewSequentialFile

src/leveldb/util/env_windows.cc:385–401  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

383 }
384
385 Status NewSequentialFile(const std::string& filename,
386 SequentialFile** result) override {
387 *result = nullptr;
388 DWORD desired_access = GENERIC_READ;
389 DWORD share_mode = FILE_SHARE_READ;
390 auto wFilename = toUtf16(filename);
391 ScopedHandle handle = ::CreateFileW(
392 wFilename.c_str(), desired_access, share_mode,
393 /*lpSecurityAttributes=*/nullptr, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL,
394 /*hTemplateFile=*/nullptr);
395 if (!handle.is_valid()) {
396 return WindowsError(filename, ::GetLastError());
397 }
398
399 *result = new WindowsSequentialFile(filename, std::move(handle));
400 return Status::OK();
401 }
402
403 Status NewRandomAccessFile(const std::string& filename,
404 RandomAccessFile** result) override {

Callers

nothing calls this directly

Calls 3

WindowsErrorFunction · 0.85
OKFunction · 0.85
is_validMethod · 0.45

Tested by

no test coverage detected