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

Function FileObjectToInfo

cpp/src/arrow/filesystem/s3fs.cc:2175–2184  ·  view source on GitHub ↗

This function assumes info->path() is already set

Source from the content-addressed store, hash-verified

2173
2174// This function assumes info->path() is already set
2175void FileObjectToInfo(std::string_view key, const S3Model::HeadObjectResult& obj,
2176 FileInfo* info) {
2177 if (IsDirectory(key, obj)) {
2178 info->set_type(FileType::Directory);
2179 } else {
2180 info->set_type(FileType::File);
2181 }
2182 info->set_size(static_cast<int64_t>(obj.GetContentLength()));
2183 info->set_mtime(FromAwsDatetime(obj.GetLastModified()));
2184}
2185
2186void FileObjectToInfo(const S3Model::Object& obj, FileInfo* info) {
2187 info->set_type(FileType::File);

Callers 2

ToFileInfosMethod · 0.85
GetFileInfoMethod · 0.85

Calls 4

FromAwsDatetimeFunction · 0.85
IsDirectoryFunction · 0.70
GetContentLengthMethod · 0.45
GetSizeMethod · 0.45

Tested by

no test coverage detected