How to get free space of internal file system?
Re: How to get free space of internal file system?
Just to give an update. The uos.statvfs() implementation has been merged in https://github.com/micropython/micropyt ... 5c2c95dd50
Re: How to get free space of internal file system?
Great! Thanks!
Re: How to get free space of internal file system?
This would do it . . .
Code: Select all
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))
-
- Posts: 1
- Joined: Sat Aug 07, 2021 5:14 pm
Re: How to get free space of internal file system?
import uos, esp
blksize = uos.statvfs('/')[0]
fbs = uos.statvfs('/')[3]
print ("Avilable storage is:",(blksize*fbs)/1024, "KB", "out of:", esp.flash_size()/1024,"KB",sep=" ")
blksize = uos.statvfs('/')[0]
fbs = uos.statvfs('/')[3]
print ("Avilable storage is:",(blksize*fbs)/1024, "KB", "out of:", esp.flash_size()/1024,"KB",sep=" ")