Page 2 of 2

Re: How to get free space of internal file system?

Posted: Thu Sep 29, 2016 10:39 am
by platforma
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?

Posted: Thu Sep 29, 2016 8:40 pm
by mad474
Great! Thanks!

Re: How to get free space of internal file system?

Posted: Wed Apr 18, 2018 3:30 pm
by DWiskow
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))