MCPcopy Create free account
hub / github.com/git/git / calcDiskFree

Function calcDiskFree

git-p4.py:177–185  ·  view source on GitHub ↗

Return free space in bytes on the disk of the given dirname.

()

Source from the content-addressed store, hash-verified

175
176
177def calcDiskFree():
178 """Return free space in bytes on the disk of the given dirname."""
179 if platform.system() == 'Windows':
180 free_bytes = ctypes.c_ulonglong(0)
181 ctypes.windll.kernel32.GetDiskFreeSpaceExW(ctypes.c_wchar_p(os.getcwd()), None, None, ctypes.pointer(free_bytes))
182 return free_bytes.value
183 else:
184 st = os.statvfs(os.getcwd())
185 return st.f_bavail * st.f_frsize
186
187
188def die(msg):

Callers 1

streamP4FilesCbMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected