You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opendal.apache.org by "DCjanus (via GitHub)" <gi...@apache.org> on 2023/05/04 11:37:19 UTC
[GitHub] [incubator-opendal] DCjanus commented on issue #2086: `is_exist` always return true for key end with '/', in S3 service
DCjanus commented on issue #2086:
URL: https://github.com/apache/incubator-opendal/issues/2086#issuecomment-1534613575
For now, in S3 backend, `operator.create_dir("test/")` would create a empty object, with key `test/`. Which might cause a lot of problem.
For example:
```
use opendal::Operator;
#[tokio::main]
async fn main() -> anyhow::Result<()> {
let mut builder = opendal::services::S3::default();
builder.endpoint("http://localhost:9000");
builder.access_key_id("minioadmin");
builder.secret_access_key("minioadmin");
builder.region("us-east-1");
builder.bucket("test");
let operator = Operator::new(builder)?.finish();
operator.create_dir("test/").await?;
// List method required path ends with '/'.
let mut lister = operator.list("test/").await?;
// Given dir would not in the list.
assert_eq!(lister.next_page().await?.unwrap().is_empty(), true);
Ok(())
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org