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
• 10,080 points
173 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
• 53,110 points

Related Questions In GCP

0 votes
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
• 53,110 points
168 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 23, 2019 in GCP by Sirajul
• 53,110 points
186 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
• 53,110 points
284 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
• 53,110 points
826 views
0 votes
1 answer
0 votes
1 answer