How to use fopen in the extended module?
How to use fopen in the extended module?
I'm writing my own module, which requires file operations. But when I write file * FP = fopen (file, "R") in the C code, the returned result is null, that is, the file does not exist. Is it because I don't have mount spiffs? But why can micropython itself read it? I use Python to execute OS Listdir () can read all the files in the directory.
Re: How to use fopen in the extended module?
As per the message, please open new posts at GitHub discussions. https://github.com/orgs/micropython/discussions
MicroPython does not make the libc file methods available. If you want to access the filesystem you need to do it through MicroPython's VFS layer. See extmod/vfs.h
MicroPython does not make the libc file methods available. If you want to access the filesystem you need to do it through MicroPython's VFS layer. See extmod/vfs.h