def get_default_sector_size():
with NamedTemporaryFile() as fp:
# Truncate to zero, so that extending the size in the next call
# will cause all the bytes to read as zero. Stevens $4.13
os.truncate(fp.name, 0)
os.truncate(fp.name, MiB(1))
return Device(fp.name).sectorSize
评论列表
文章目录