-
Notifications
You must be signed in to change notification settings - Fork 74k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add create dir, delete dir/file #41082
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor nit is just a question.
return; | ||
} | ||
|
||
MaybeAppendSlash(&object); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Can we ensure that object
always ends with a /
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry I dont understand what you mean. MaybeAppendSlach
will ensure object will end with a '/'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant object
is always produced by other functions. Can we ensure that those functions add the trailing slash?
Basically, from the point of view of a caller to ParseGCSPath
, object
either always has the trailing /
or not but not something in between. Otherwise, you always have to write code that uses both ParseGCSPath
and MaybeAppendSlash
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we could force object
always has the trailing /
or not in ParseGCSPath
but it causes many unwanted behaviors.
In the local filesystem, we have a function mkdir
to create directory and the directory name can have /
or not, it does not matter.
But with gcs
filesystem, we have to create an empty object with the name ends with /
so Google Cloud Console could display it as a directory.
If we force object
does not have /
at the end, Google Cloud Console will display that object as a empty object.
If we force object
has /
at the end, Google Cloud Console will display everything as a directory ( even the object's size is bigger than 0 ).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, then let's leave it as it is
This PR adds create dir, delete dir/file