3 ms·
Why is it useful?
by vbezhenar 4y ago
Why is it useful?
- mdaniel 4y agoThat's a complicated question but allows highlighting what I was bringing up: the Key is any unicode character[1] so while it has become conventional to use "/", imagine if you wanted to store the output of exploded jar files in S3, but be able to "list the directory" of a jar's contents: `PutObject("/some-path/my.jar!/META-INF/MANIFEST.MF", "Manifest-Version: 1.0")` Now you can `ListObjects(Prefix="/some-path/my.jar", Delimiter="!")` to get the "interior files" back. I'm sure there are others, that's just one that I could think of off the top of my head. Mapping a URL and its interior resources would be another (`"https://example.com\t/script[1] https://example.com\t/script[1]", "console.log('hello, world')")` Further fun fact that even I didn't know until searching for other examples: "delimiter" is a string and thus can be `Delimiter=unknown` or such: https://github.com/aws/aws-sdk-go/issues/2130 https://github.com/aws/aws-sdk-go/issues/2130 1: see the ListObject page under "encoding-type"
- selfhoster11 4y agoMinio supports virtual ZIP directories for such use cases. In your example, as long as this was enabled and your jar file was properly detected, you could submit a GET for "/some-path/my.jar/META-INF/MANIFEST.MF" and get the contents of that file just fine.
- mdaniel 4y agoOne will observe I said list, not get, although in this case it's likely a non-issue because Minio supports the S3 API https://github.com/minio/minio-go/blob/v7.0.45/api-list.go#L171 https://github.com/minio/minio-go/blob/v7.0.45/api-list.go#L... and thus should support the 2nd example I provided, too
- orf 4y agoImagine you have a billion files in a “directory”. Being able to find files that start with “xyz” in constant time is a very, very useful property.