Description
While the docstring for mkdir is correct that S3 doesn't have folders, the s3 console still gives you the "illusion" of directories implied by slashes in object keys. It also lets you create "directories" which are just 0 byte objects with keys ending with a slash, and I have some use cases that use these. It's not possible as far as I can tell to create these with S3Path because the pathlib API strips trailing slashes.
I propose we enhance the mkdir function to create an empty object named with a trailing slash.
For example, S3Path('/some-bucket/some-directory').mkdir()
creates an object in bucket some-bucket
and key some-directory/
.
Setting parents=True
would create the bucket first if necessary.
I don't think it's necessary for mkdir to also create parent directories (i.e. it's not required for the s3 console to see directories) but for consistency, I think it could be argued that they should be created anyway for the sake of consistency.