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

Method OpenWritable

cpp/src/arrow/io/file.cc:71–85  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

69 // Note: only one of the Open* methods below may be called on a given instance
70
71 Status OpenWritable(const std::string& path, bool truncate, bool append,
72 bool write_only) {
73 RETURN_NOT_OK(SetFileName(path));
74
75 ARROW_ASSIGN_OR_RAISE(fd_, ::arrow::internal::FileOpenWritable(file_name_, write_only,
76 truncate, append));
77 mode_ = write_only ? FileMode::WRITE : FileMode::READWRITE;
78
79 if (!truncate) {
80 ARROW_ASSIGN_OR_RAISE(size_, ::arrow::internal::FileGetSize(fd_.fd()));
81 } else {
82 size_ = 0;
83 }
84 return Status::OK();
85 }
86
87 // This is different from OpenWritable(string, ...) in that it doesn't
88 // truncate nor mandate a seekable file

Callers 1

OpenMethod · 0.45

Calls 7

FileOpenWritableFunction · 0.85
FileGetSizeFunction · 0.85
FileDescriptorFunction · 0.85
ARROW_ASSIGN_OR_RAISEFunction · 0.50
OKFunction · 0.50
fdMethod · 0.45
okMethod · 0.45

Tested by

no test coverage detected