Reputation: 193
I want to remove the object of the object name is "."
$ gsutil ls gs://{my_bucket}
gs://{my_bucket}/.
I tried, but are not remove.
$ gsutil -m rm "gs://{my_bucket}/**"
Removing gs://{my_bucket}/....
CommandException: 1 files/objects could not be removed.
$ gsutil rm "gs://{my_bucket}/."
$ gsutil rm gs://{my_bucket}/.
BadRequestException: 400 Invalid field selection name
help me
Upvotes: 2
Views: 908
Reputation: 38379
You cannot easily remove objects with the name ".". This is a known bug.
Requests to delete objects are ultimately sent as HTTP DELETE requests with the object name as the last path segment of the URL. RFC 3986 calls for the path segments . or .. to be stripped out of URLs as if they were being resolved as Unix paths, and most HTTP clients and servers obey the RFC. Thus a request to delete such a path can't easily be constructed. This is true even if you were to try URL escaping the dots.
There are a few sneaky ways to get around this problem, but they're quite complex and arcane. The best way may be for you to contact support and ask for the object to be removed.
Upvotes: 2