You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-09 12:50:35 +00:00
Fix: Make get_space_left on Windows use current_dir instead of process CWD
This commit is contained in:
@@ -329,7 +329,14 @@ Error DirAccessWindows::remove(String p_path) {
|
|||||||
|
|
||||||
uint64_t DirAccessWindows::get_space_left() {
|
uint64_t DirAccessWindows::get_space_left() {
|
||||||
uint64_t bytes = 0;
|
uint64_t bytes = 0;
|
||||||
if (!GetDiskFreeSpaceEx(nullptr, (PULARGE_INTEGER)&bytes, nullptr, nullptr)) {
|
|
||||||
|
String path = fix_path(current_dir);
|
||||||
|
|
||||||
|
if (!path.ends_with("\\")) {
|
||||||
|
path += "\\";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!GetDiskFreeSpaceExW((LPCWSTR)(path.utf16().get_data()), (PULARGE_INTEGER)&bytes, nullptr, nullptr)) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user