GCP I tried to use the gsutil stat command to display object status for a subdirectory and got an error

0 votes
Oct 25, 2019 in GCP by Karan
• 19,610 points
1,587 views

1 answer to this question.

0 votes

Cloud Storage uses a flat namespace to store objects in buckets. While you can use slashes ("/") in object names to make it appear as if objects are in a hierarchical structure, the gsutil stat command treats a trailing slash as part of the object name.

For example, if you run the command gsutil -q stat gs://my-bucket/my-object/, gsutil looks up information about the object my-object/ (with a trailing slash), as opposed to operating on objects nested under my-bucket/my-object/. Unless you actually have an object with that name, the operation fails.

For subdirectory listing, use the gsutil ls instead.

answered Oct 25, 2019 by Sirajul
• 59,230 points

Related Questions In GCP

+1 vote
1 answer
0 votes
1 answer

How can i grant access to a GCP project for a large scale multiple users at once?

gcloud auth to service accounts is allowed. ...READ MORE

answered Oct 16, 2019 in GCP by Sirajul
• 59,230 points
1,332 views
0 votes
1 answer

How to copy an object to a folder in the bucket?

Use the gsutil cp command to create a folder ...READ MORE

answered Oct 24, 2019 in GCP by Sirajul
• 59,230 points
1,978 views
0 votes
1 answer

GCP Error: 403: Access Denied

Check that your credentials are correct. For ...READ MORE

answered Oct 9, 2019 in GCP by Sirajul
• 59,230 points
3,984 views
0 votes
1 answer

Permissions issue with Google Cloud Storage Bucket.

You can regain access to the object by assigning an applicable role, like roles/storage.objectAdmin, to ...READ MORE

answered Oct 10, 2019 in GCP by Sirajul
• 59,230 points
4,915 views
0 votes
1 answer
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP