14 lines
374 B
Python
14 lines
374 B
Python
import subprocess
|
|
import platform
|
|
|
|
class Util:
|
|
@staticmethod
|
|
def get_free_space():
|
|
if platform.system() == 'Linux':
|
|
df = subprocess.Popen(["df", "/"], stdout=subprocess.PIPE)
|
|
output = df.communicate()[0]
|
|
device, size, used, available, percent, mountpoint = str(output).split("\\n")[1].split()
|
|
else:
|
|
available = 1024*1024*1024*1024;
|
|
return int(available)
|