8000 unix: remove custome file.c code and use extmod's VFS-POSIX version instead by dpgeorge · Pull Request #5769 · micropython/micropython · GitHub
[go: up one dir, main page]

Skip to content

unix: remove custome file.c code and use extmod's VFS-POSIX version instead #5769

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 18, 2020

Conversation

dpgeorge
Copy link
Member

Even if the unix port doesn't use the VFS subsystem it can still use the VFS POSIX file code because it's equivalent to the custom code in ports/unix/file.c.

@stinos
Copy link
Contributor
stinos commented Mar 18, 2020

This is good. For Windows you'll have to explcicitly add vfs_posix_file.c in both Makefile and sources.props. Or maybe these files should just default to use extmod/*.c but I assume there's a reason they don't. I can look into that if you want?

Edit: too fast, py.mk also doesn't use extmod/*.o so the Windows ports should also explicitly add the files they need.

@dpgeorge
Copy link
Member Author

Thanks for the review and suggestion. I think I have the Windows and MSVC builds worked out now.

Also support MP_STREAM_GET_FILENO ioctl.  The stdio flush change was done
previously for the unix port in 3e0b46b.
These changes make this POSIX file implementation equivalent to the unix
file implementation.
The implementation in extmod/vfs_posix_file.c is now equivalent to that in
ports/unix/file.c, so remove the latter and use the former instead.