diff options
author | Jim Mussared <jim.mussared@gmail.com> | 2022-12-21 11:36:18 +1100 |
---|---|---|
committer | Damien George <damien@micropython.org> | 2023-01-13 16:38:34 +1100 |
commit | aa64280666d40208ade0183503fe683fbb32c2ab (patch) | |
tree | 06ecd876a6443bbc7d48d8efea4e069b75c9dfad /docs/esp32 | |
parent | 6013d27dd59dd111041f72106a5a5eddfb02a792 (diff) |
tools/pyboard.py: Add fs_{listdir,readfile,writefile,stat}.
These are for working with the filesystem when using pyboard.py as a
library, rather than at the command line.
- fs_listdir returns a list of tuples, in the same format as os.ilistdir().
- fs_readfile returns the contents of a file as a bytes object.
- fs_writefile allows writing a bytes object to a file.
- fs_stat returns an os.statresult.
All raise FileNotFoundError (or OSError(ENOENT) on Python 2) if the file is
not found (or PyboardError on other errors).
Updated fs_cp and fs_get to use fs_stat to compute file size.
This work was funded through GitHub Sponsors.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
Diffstat (limited to 'docs/esp32')
0 files changed, 0 insertions, 0 deletions