read num bytes used from file instead of calculating manually
This commit is contained in:
parent
3d103aed0f
commit
d47469be25
@ -217,10 +217,14 @@ class Application_Model_Systemstatus
|
||||
//connect to DB and find how much total space user has allocated.
|
||||
$totalSpace = Application_Model_Preference::GetDiskQuota();
|
||||
|
||||
$storPath = Application_Model_MusicDir::getStorDir()->getDirectory();
|
||||
|
||||
list($usedSpace,) = preg_split("/[\s]+/", exec("du -bs $storPath"));
|
||||
$path = $_SERVER['AIRTIME_BASE']."etc/airtime/num_bytes.ini";
|
||||
$arr = parse_ini_file($path);
|
||||
|
||||
$usedSpace = 0;
|
||||
if ($arr !== false) {
|
||||
$usedSpace = $arr['num_bytes'];
|
||||
}
|
||||
|
||||
$partitions[$totalSpace]->totalSpace = $totalSpace;
|
||||
$partitions[$totalSpace]->totalFreeSpace = $totalSpace - $usedSpace;
|
||||
Logging::info($partitions[$totalSpace]->totalFreeSpace);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user