linkExist && file_exists(rTorrentSettings::get()->directory)) { $partitionDirectories = [rTorrentSettings::get()->directory => '']; } else { $partitionDirectories = [$topDirectory => '']; } } $ret = []; foreach (array_keys($partitionDirectories) as $dir) { $item = [ "total" => 0, "free" => 0, ]; if (is_dir($dir)) { $item["total"] = disk_total_space($dir); $item["free"] = disk_free_space($dir); } $ret[] = $item; } CachedEcho::send(JSON::safeEncode($ret), "application/json");