How to add VFS support to windows port?

Discussion about programs, libraries and tools that work with MicroPython. Mostly these are provided by a third party.
Target audience: All users and developers of MicroPython.
Post Reply
rockindy
Posts: 5
Joined: Fri Apr 24, 2020 2:56 am

How to add VFS support to windows port?

Post by rockindy » Wed Nov 11, 2020 7:55 am

I have added following configs to port/windows/mpconfigport.h but with no luck.

Code: Select all

#define MICROPY_VFS                    (1)
#define MICROPY_VFS_POSIX              (1)
#define MICROPY_PY_UOS_VFS             (1)
#define MICROPY_READER_VFS             (1)
#define MICROPY_PY_OS_STATVFS          (0)

#define mp_import_stat mp_vfs_import_stat
#define mp_builtin_open mp_vfs_open
#define mp_builtin_open_obj mp_vfs_open_obj
Error:
../../extmod/vfs_posix.c:323:10: fatal error: sys/statvfs.h: No such file or directory

And mingw doesn't have statvfs.h.

stijn
Posts: 735
Joined: Thu Apr 24, 2014 9:13 am

Re: How to add VFS support to windows port?

Post by stijn » Wed Nov 11, 2020 8:15 am

Couple of options here:
- remove the parts relying on statvfs.h (only vfs_posix_statvfs I think?) by making them conditional with a preprocessor directive
- find an existing statvfs.h implementation for windows implementation on the web
- implement equivalent of statvfs() etc yourself on windows

Post Reply