Search found 3 matches

by m.elkhouly
Fri May 24, 2019 9:16 pm
Forum: Development of MicroPython
Topic: [SOLVED] filesystem access from c module
Replies: 5
Views: 1550

Re: filesystem access from c module

the mpfile module did the trick for me.
thanks for the help.
by m.elkhouly
Wed May 22, 2019 6:27 pm
Forum: Development of MicroPython
Topic: [SOLVED] filesystem access from c module
Replies: 5
Views: 1550

Re: filesystem access from c module

[quote=jimmo post_id=36795 time=1558542758 user_id=3071] If you include "py/builtin.h" you can use mp_builtin_open_obj directly to get the open function. But you'll need to use mp_load_attr to get the file methods like read/write. What goes wrong when you try to write to it? Compile or runtime error...
by m.elkhouly
Wed May 22, 2019 12:56 pm
Forum: Development of MicroPython
Topic: [SOLVED] filesystem access from c module
Replies: 5
Views: 1550

[SOLVED] filesystem access from c module

hello, i'm writing a C module that needs to create and handle file operations, and i got lost trying to find a way to do that. [code] char *pth = "text.txt" ; mp_obj_t dest[2]; mp_obj_t file; dest[0] = mp_obj_new_str(pth, strlen(pth)); dest[1] = mp_obj_new_str("w", 1); mp_obj_t file_obj = mp_module_...