summaryrefslogtreecommitdiff
path: root/stmhal/file.c
diff options
context:
space:
mode:
authorPaul Sokolovsky <pfalcon@users.sourceforge.net>2014-10-18 22:44:07 +0300
committerPaul Sokolovsky <pfalcon@users.sourceforge.net>2014-10-18 22:44:07 +0300
commit1a55b6a787ee7a568550ac0510632965af61c9ee (patch)
tree61f49937226e3dfb945adecef74cc1eff3dfc57e /stmhal/file.c
parentc92672d7f8fc410477a4e25789d15c1fd99b675b (diff)
unix, stmhal: Implement file.readinto() method.
Also, usocket.readinto(). Known issue is that .readinto() should be available only for binary files, but micropython uses single method table for both binary and text files.
Diffstat (limited to 'stmhal/file.c')
-rw-r--r--stmhal/file.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/stmhal/file.c b/stmhal/file.c
index 99e3cefd0..d49a8a259 100644
--- a/stmhal/file.c
+++ b/stmhal/file.c
@@ -222,6 +222,7 @@ STATIC mp_obj_t file_obj_make_new(mp_obj_t type, mp_uint_t n_args, mp_uint_t n_k
STATIC const mp_map_elem_t rawfile_locals_dict_table[] = {
{ MP_OBJ_NEW_QSTR(MP_QSTR_read), (mp_obj_t)&mp_stream_read_obj },
{ MP_OBJ_NEW_QSTR(MP_QSTR_readall), (mp_obj_t)&mp_stream_readall_obj },
+ { MP_OBJ_NEW_QSTR(MP_QSTR_readinto), (mp_obj_t)&mp_stream_readinto_obj },
{ MP_OBJ_NEW_QSTR(MP_QSTR_readline), (mp_obj_t)&mp_stream_unbuffered_readline_obj},
{ MP_OBJ_NEW_QSTR(MP_QSTR_readlines), (mp_obj_t)&mp_stream_unbuffered_readlines_obj},
{ MP_OBJ_NEW_QSTR(MP_QSTR_write), (mp_obj_t)&mp_stream_write_obj },