diff options
author | Damien George <damien.p.george@gmail.com> | 2017-06-07 15:29:53 +1000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2017-06-07 15:29:53 +1000 |
commit | 7ecfbb8267c050ba5bd5bdf7becfb055f53a4f80 (patch) | |
tree | 39973479e89268204d360e8cd4950ebcbdad9138 /extmod/vfs.c | |
parent | f6ef8e3f17222a397e02f93a8b0d283e0f6c9793 (diff) | |
download | micropython-7ecfbb8267c050ba5bd5bdf7becfb055f53a4f80.tar.gz micropython-7ecfbb8267c050ba5bd5bdf7becfb055f53a4f80.zip |
extmod/vfs: Allow "buffering" and "encoding" args to VFS's open().
These args are currently ignored but are parsed to make it easier to
write portable scripts between CPython and MicroPython.
Diffstat (limited to 'extmod/vfs.c')
-rw-r--r-- | extmod/vfs.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/extmod/vfs.c b/extmod/vfs.c index b75ec75169..3bdce80db8 100644 --- a/extmod/vfs.c +++ b/extmod/vfs.c @@ -228,11 +228,14 @@ mp_obj_t mp_vfs_umount(mp_obj_t mnt_in) { } MP_DEFINE_CONST_FUN_OBJ_1(mp_vfs_umount_obj, mp_vfs_umount); +// Note: buffering and encoding args are currently ignored mp_obj_t mp_vfs_open(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_file, ARG_mode, ARG_encoding }; static const mp_arg_t allowed_args[] = { { MP_QSTR_file, MP_ARG_OBJ | MP_ARG_REQUIRED, {.u_rom_obj = MP_ROM_PTR(&mp_const_none_obj)} }, { MP_QSTR_mode, MP_ARG_OBJ, {.u_rom_obj = MP_ROM_QSTR(MP_QSTR_r)} }, + { MP_QSTR_buffering, MP_ARG_INT, {.u_int = -1} }, + { MP_QSTR_encoding, MP_ARG_OBJ, {.u_rom_obj = MP_ROM_PTR(&mp_const_none_obj)} }, }; // parse args |