디스크 용량 확인 및 기타 수정
This commit is contained in:
9
Crawler/Util.py
Normal file
9
Crawler/Util.py
Normal file
@@ -0,0 +1,9 @@
|
||||
import subprocess
|
||||
|
||||
class Util:
|
||||
@staticmethod
|
||||
def get_free_space():
|
||||
df = subprocess.Popen(["df", "/"], stdout=subprocess.PIPE)
|
||||
output = df.communicate()[0]
|
||||
device, size, used, available, percent, mountpoint = str(output).split("\\n")[1].split()
|
||||
return int(available)
|
||||
Reference in New Issue
Block a user