def diskUsage(path):
"""Return disk usage statistics about the given path. Inspired by:
https://stackoverflow.com/questions/4274899/get-actual-disk-space
Returned values is a named tuple with attributes 'total', 'used' and
'free', which are the amount of total, used and free space, in bytes.
"""
st = os.statvfs(path)
free = st.f_bavail * st.f_frsize
total = st.f_blocks * st.f_frsize
used = (st.f_blocks - st.f_bfree) * st.f_frsize
return {'total':total, 'used':used, 'free':free}
########################
### Convert to FASTQ ###
########################
### Before beginning, check there is enough memory on disk
评论列表
文章目录