MCPcopy Index your code
hub / github.com/pyload/pyload / freeSpace

Function freeSpace

module/utils.py:106–117  ·  view source on GitHub ↗
(folder)

Source from the content-addressed store, hash-verified

104
105
106def freeSpace(folder):
107 if os.name == "nt":
108 import ctypes
109
110 free_bytes = ctypes.c_ulonglong(0)
111 ctypes.windll.kernel32.GetDiskFreeSpaceExW(ctypes.c_wchar_p(folder), None, None, ctypes.pointer(free_bytes))
112 return free_bytes.value
113 else:
114 from os import statvfs
115
116 s = statvfs(folder)
117 return s.f_bsize * s.f_bavail
118
119
120def uniqify(seq, idfun=None):

Callers 4

startMethod · 0.90
assignJobMethod · 0.90
freeSpaceMethod · 0.90
utils.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected