Created
June 16, 2023 23:37
-
-
Save chapmanjacobd/9c0be8a41aed854f9d7faa2def15c7f1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def calculate_sparseness(stat) -> int: | |
if stat.st_size == 0: | |
sparseness = 0 | |
else: | |
blocks_allocated = stat.st_blocks * 512 | |
sparseness = blocks_allocated / stat.st_size | |
return sparseness |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment