mirror of
https://github.com/abraunegg/onedrive
synced 2024-05-09 17:26:47 +02:00
Merge pull request #204 from lanhin/master
Fixed bugs where the app fails to create nested directories.
This commit is contained in:
commit
1558e793a3
|
@ -123,10 +123,14 @@ final class OneDriveApi
|
|||
void downloadById(const(char)[] id, string saveToPath)
|
||||
{
|
||||
checkAccessTokenExpired();
|
||||
import std.file;
|
||||
scope(failure) {
|
||||
import std.file;
|
||||
if (exists(saveToPath)) remove(saveToPath);
|
||||
}
|
||||
// mkdir if need, or File(saveToPath, "wb") may fail
|
||||
if ( !exists(dirName(saveToPath)) ) {
|
||||
mkdirRecurse(dirName(saveToPath));
|
||||
}
|
||||
const(char)[] url = itemByIdUrl ~ id ~ "/content?AVOverride=1";
|
||||
download(url, saveToPath);
|
||||
}
|
||||
|
|
|
@ -281,8 +281,9 @@ final class SyncEngine
|
|||
break;
|
||||
case ItemType.dir:
|
||||
log.log("Creating directory: ", path);
|
||||
mkdir(path);
|
||||
break;
|
||||
//Use mkdirRecuse to deal nested dir
|
||||
mkdirRecurse(path);
|
||||
break;
|
||||
case ItemType.remote:
|
||||
assert(0);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue