saalfeldlab/n5-aws-s3

`basePath` arguments for N5KeyValueReaders/Writers

bogovicj opened this issue · 0 comments

@hanslovsky pointed out some strange behavior in the current setup here (thanks Philipp!). This issue discusses these points:

When using AWS SDK I can only successfully list the contents of store/ in the zarr-demo bucket if I omit the leading slash (i.e. store/ works but not /store)
...
I should be able to create ZarrKeyValueReader with or without leading slash. Trailing slash should probably be significant because it is significant in AWS S3 (but not on the file system)

Agree that with or without leading slash should work. There's a consequence to this:

basePath is relative to the bucket root, whether or not it starts with a leading slash

This is different behavior than for local filesytems, where a leading slash indicates the path is absolute, otherwise the path is relative. @cmhulbert and I talked, and think this is fine.

To summarize with examples, these three basePaths will be identical:

  • "store"
  • "/store"
  • "/store/"
  • "store/"

This should work as of fd10ee5. Note that the basePaths below are different

  • "./store"
  • "//store"

see #19