DCjanus opened a new issue, #2086: URL: https://github.com/apache/incubator-opendal/issues/2086
Because of [this line](https://github.com/apache/incubator-opendal/blob/fa9e5d1b07475e100503200f33fc6bc2250ddff2/core/src/services/s3/backend.rs#L1022-L1024), if key end with '/', `S3.stat` would never return `NotFound` error. And `is_exist` [relay on](https://github.com/apache/incubator-opendal/blob/fa9e5d1b07475e100503200f33fc6bc2250ddff2/core/src/types/operator/operator.rs#L348-L357) this error to detect if a key is exists. Which means, if we was trying to detect a dir is exists, S3 backend would always return true, which might be confusing. ```Rust 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(); assert_eq!(operator.is_exist("/no_exists/").await?, 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
