Fix Directory::get_space_left() result on macOS and Linux. - #49222
Conversation
|
Thanks! |
|
Cherry-picked for 3.4. |
|
Cherry-picked for 3.3.3. |
|
By the way, is this "Truncate to closest MiB" part of the GDScript binding necessary for something, or it's just an artifact from the broken conversion to MiB? Previously it has comment "return value in megabytes, given binding is int", but code was the same (missing bracket?). Line 1725 in 652a9de |
|
I changed the comment because the previous one didn't make sense given the code and was too orthogonal to the changes in #47254. But yeah the intent was maybe actually to return MiB instead of bytes since those are typically big values which could easily be more than I think we could either remove the truncation and keep bytes (and document it, current classref doesn't say the unit), or actually convert to MiB. The latter is maybe the most user-friendly? |
Fix `Directory::get_space_left()` result on macOS and Linux.
Fix `Directory::get_space_left()` result on macOS and Linux.
Fix `Directory::get_space_left()` result on macOS and Linux.
fragme_sizeinstead ofblock_sizeas base unit.dfandmcand some other Linux file managers).Tested on macOS 11.4, Ubuntu 21.04 (x86-64), Mageia 8 (x86-64 and i586) with different file systems.
Fixes #47262