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

Method CreateEmptyDir

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

Create a directory-like object with empty contents. Successful if already exists.

Source from the content-addressed store, hash-verified

2366
2367 // Create a directory-like object with empty contents. Successful if already exists.
2368 Status CreateEmptyDir(const std::string& bucket, std::string_view key_view) {
2369 ARROW_ASSIGN_OR_RAISE(auto client_lock, holder_->Lock());
2370
2371 auto key = internal::EnsureTrailingSlash(key_view);
2372 S3Model::PutObjectRequest req;
2373 req.SetBucket(ToAwsString(bucket));
2374 req.SetKey(ToAwsString(key));
2375 req.SetContentType(kAwsDirectoryContentType);
2376 return OutcomeToStatus(
2377 std::forward_as_tuple("When creating key '", key, "' in bucket '", bucket, "': "),
2378 "PutObject", client_lock.Move()->PutObject(req));
2379 }
2380
2381 Status DeleteObject(const std::string& bucket, const std::string& key) {
2382 ARROW_ASSIGN_OR_RAISE(auto client_lock, holder_->Lock());

Callers 1

CreateDirMethod · 0.80

Calls 4

EnsureTrailingSlashFunction · 0.85
ToAwsStringFunction · 0.85
OutcomeToStatusFunction · 0.85
MoveMethod · 0.45

Tested by

no test coverage detected