From 494b32ff70dfc3202005d7aa86e7bf2ba70a74aa Mon Sep 17 00:00:00 2001 From: "Kirill Lipatov (Leency)" Date: Mon, 18 Sep 2017 08:38:34 +0000 Subject: [PATCH] file_system.h: add function ConverSize64 for files bigger than 4Gb git-svn-id: svn://kolibrios.org@6988 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/cmm/lib/file_system.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/programs/cmm/lib/file_system.h b/programs/cmm/lib/file_system.h index 11c20a0f89..598144064b 100644 --- a/programs/cmm/lib/file_system.h +++ b/programs/cmm/lib/file_system.h @@ -297,6 +297,18 @@ enum sprintf(#ConvertSize_size_prefix,"%d %s",bytes,#size_nm); return #ConvertSize_size_prefix; } +:dword ConvertSize64(dword bytes_lo, bytes_hi) +{ + debugval("bytes_lo", bytes_lo); + debugval("bytes_hi", bytes_hi); + + if (bytes_hi > 0) { + if (bytes_lo>=1073741824) bytes_lo /= 1073741824; else bytes_lo = 0; + sprintf(#ConvertSize_size_prefix,"%d Gb",bytes_hi*4 + bytes_lo); + return #ConvertSize_size_prefix; + } + else return ConvertSize(bytes_lo); +} :dword notify(dword notify_param) { return RunProgram("/sys/@notify", notify_param);