Created
June 13, 2024 02:20
-
-
Save jouellnyc/b11833c07371a8986439e3c50b2e7861 to your computer and use it in GitHub Desktop.
How to get free space of internal file system - micropython
This file contains hidden or 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
# Credit https://forum.micropython.org/viewtopic.php?f=16&t=2361&start=10 | |
import uos | |
fs_stat = uos.statvfs('/') | |
fs_size = fs_stat[0] * fs_stat[2] | |
fs_free = fs_stat[0] * fs_stat[3] | |
print("File System Size {:,} - Free Space {:,}".format(fs_size, fs_free)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment