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.

8000
@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.
@dpgeorge dpgeorge force-pushed the unix-use-vfs-posix-file branch from b54f835 to 2cdf1d2 Compare March 18, 2020 10:02
@stinos
Copy link
Contributor
stinos commented Mar 18, 2020

Yes should be good. Tests still pass and they cover this pretty well I think.

@dpgeorge dpgeorge merged commit 2cdf1d2 into micropython:master Mar 18, 2020
@dpgeorge dpgeorge deleted the unix-use-vfs-posix-file branch March 18, 2020 10:17
@dpgeorge
Copy link
Member Author

Tests still pass and they cover this pretty well I think.

Yes, there are tests/io/* for this.

tannewt pushed a commit to tannewt/circuitpython that referenced this pull request Dec 29, 2021
…n-main

Translations update from Hosted Weblate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0