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

Method CreateDir

cpp/src/arrow/filesystem/gcsfs.cc:494–510  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

492 }
493
494 Status CreateDir(const GcsPath& p) {
495 if (p.object.empty()) {
496 auto metadata =
497 gcs::BucketMetadata().set_location(options_.default_bucket_location);
498 return internal::ToArrowStatus(client_.CreateBucket(p.bucket, metadata).status());
499 }
500 auto parent = p.parent();
501 if (!parent.object.empty()) {
502 auto o = client_.GetObjectMetadata(p.bucket,
503 internal::EnsureTrailingSlash(parent.object));
504 if (!o.ok()) {
505 return internal::ToArrowStatus(o.status());
506 }
507 if (!IsDirectory(*o)) return NotDirectoryError(*o);
508 }
509 return internal::ToArrowStatus(CreateDirMarker(p.bucket, p.object).status());
510 }
511
512 Status CreateDirRecursive(const GcsPath& p) {
513 return CreateDirMarkerRecursive(p.bucket, p.object);

Callers

nothing calls this directly

Calls 9

EnsureTrailingSlashFunction · 0.85
CreateBucketMethod · 0.80
GetObjectMetadataMethod · 0.80
ToArrowStatusFunction · 0.70
IsDirectoryFunction · 0.70
emptyMethod · 0.45
statusMethod · 0.45
parentMethod · 0.45
okMethod · 0.45

Tested by

no test coverage detected