mirror of
https://github.com/minio/minio-rs.git
synced 2025-12-06 23:36:52 +08:00
Fix download file error (#69)
Fixed the error where the path does not exist when downloading files with paths like 'xxx/xxx/xxx/xxx.xx'.
This commit is contained in:
parent
e1542939b3
commit
de434ed179
@ -1515,7 +1515,12 @@ impl Client {
|
|||||||
unmodified_since: None,
|
unmodified_since: None,
|
||||||
})
|
})
|
||||||
.await?;
|
.await?;
|
||||||
|
let path = Path::new(&args.filename);
|
||||||
|
if let Some(parent_dir) = path.parent() {
|
||||||
|
if !parent_dir.exists() {
|
||||||
|
fs::create_dir_all(parent_dir)?;
|
||||||
|
}
|
||||||
|
}
|
||||||
let mut file = match args.overwrite {
|
let mut file = match args.overwrite {
|
||||||
true => File::create(args.filename)?,
|
true => File::create(args.filename)?,
|
||||||
false => File::options()
|
false => File::options()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user