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

Method CreateEmptyDir

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

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

Source from the content-addressed store, hash-verified

2307
2308 // Create a directory-like object with empty contents. Successful if already exists.
2309 Status CreateEmptyDir(const std::string& bucket, std::string_view key_view) {
2310 ARROW_ASSIGN_OR_RAISE(auto client_lock, holder_->Lock());
2311
2312 auto key = internal::EnsureTrailingSlash(key_view);
2313 S3Model::PutObjectRequest req;
2314 req.SetBucket(ToAwsString(bucket));
2315 req.SetKey(ToAwsString(key));
2316 req.SetContentType(kAwsDirectoryContentType);
2317 return OutcomeToStatus(
2318 std::forward_as_tuple("When creating key '", key, "' in bucket '", bucket, "': "),
2319 "PutObject", client_lock.Move()->PutObject(req));
2320 }
2321
2322 Status DeleteObject(const std::string& bucket, const std::string& key) {
2323 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