-made get_space_left() return values more homogenous, also for script, converted to mb, closes #4617

This commit is contained in:
Juan Linietsky 2016-06-18 11:32:45 -03:00
parent 61655d6dc2
commit e3905a084e
3 changed files with 4 additions and 3 deletions

View file

@ -321,7 +321,7 @@ size_t DirAccessUnix::get_space_left() {
struct statvfs vfs;
if (statvfs(current_dir.utf8().get_data(), &vfs) != 0) {
return -1;
return 0;
};
return vfs.f_bfree * vfs.f_bsize;

View file

@ -359,7 +359,8 @@ FileType DirAccessWindows::get_file_type(const String& p_file) const {
size_t DirAccessWindows::get_space_left() {
uint64_t bytes = 0;
GetDiskFreeSpaceEx(NULL,(PULARGE_INTEGER)&bytes,NULL,NULL);
if (!GetDiskFreeSpaceEx(NULL,(PULARGE_INTEGER)&bytes,NULL,NULL))
return 0;
//this is either 0 or a value in bytes.
return (size_t)bytes;