MCPcopy Create free account
hub / github.com/apache/arrow / OpenOutputStreamGeneric

Function OpenOutputStreamGeneric

cpp/src/arrow/filesystem/localfs.cc:688–702  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

686namespace {
687
688Result<std::shared_ptr<io::OutputStream>> OpenOutputStreamGeneric(const std::string& path,
689 bool truncate,
690 bool append) {
691 RETURN_NOT_OK(ValidatePath(path));
692 ARROW_ASSIGN_OR_RAISE(auto fn, PlatformFilename::FromString(path));
693 const bool write_only = true;
694 ARROW_ASSIGN_OR_RAISE(
695 auto fd, ::arrow::internal::FileOpenWritable(fn, write_only, truncate, append));
696 int raw_fd = fd.Detach();
697 auto maybe_stream = io::FileOutputStream::Open(raw_fd);
698 if (!maybe_stream.ok()) {
699 ARROW_UNUSED(::arrow::internal::FileClose(raw_fd));
700 }
701 return maybe_stream;
702}
703
704} // namespace
705

Callers 4

OpenOutputStreamMethod · 0.85
OpenAppendStreamMethod · 0.85
OpenOutputStreamMethod · 0.85
OpenAppendStreamMethod · 0.85

Calls 4

FileCloseFunction · 0.85
ValidatePathFunction · 0.70
DetachMethod · 0.45
okMethod · 0.45

Tested by

no test coverage detected