From 00c1fc6d77ede97f8bd9b486b0eed7afb2a3a9e0 Mon Sep 17 00:00:00 2001 From: Alex March Date: Tue, 27 Sep 2016 10:29:31 +0100 Subject: [PATCH] docs/uos: Add uos.statvfs() documentation. --- docs/library/uos.rst | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/docs/library/uos.rst b/docs/library/uos.rst index 77a61ca449..242e8c3d0b 100644 --- a/docs/library/uos.rst +++ b/docs/library/uos.rst @@ -61,6 +61,29 @@ Functions Get the status of a file or directory. +.. only:: port_unix or port_pyboard or port_esp8266 + + .. function:: statvfs(path) + + Get the status of a fileystem. + + Returns a tuple with the filesystem information in the following order: + + * ``f_bsize`` -- file system block size + * ``f_frsize`` -- fragment size + * ``f_blocks`` -- size of fs in f_frsize units + * ``f_bfree`` -- number of free blocks + * ``f_bavail`` -- number of free blocks for unpriviliged users + * ``f_files`` -- number of inodes + * ``f_ffree`` -- number of free inodes + * ``f_favail`` -- number of free inodes for unpriviliged users + * ``f_flag`` -- mount flags + * ``f_namemax`` -- maximum filename length + + Parameters related to inodes: ``f_files``, ``f_ffree``, ``f_avail`` + and the ``f_flags`` parameter may return ``0`` as they can be unavailable + in a port-specific implementation. + .. function:: sync() Sync all filesystems.