Skip to content
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

File Transfers Broken with newer versions of Visual C++ #4

Closed
davidrg opened this issue Jul 20, 2022 · 1 comment
Closed

File Transfers Broken with newer versions of Visual C++ #4

davidrg opened this issue Jul 20, 2022 · 1 comment
Assignees
Labels

Comments

@davidrg
Copy link
Owner

davidrg commented Jul 20, 2022

This is known to affect Visual C++ 14.x (2015, 2017, 2019, 2022) but likely affects all versions going back to 9.0 (2008) - see #1.

This needs fixing This needs fixing before switching over to a newer version of Visual C++ is possible.

@davidrg
Copy link
Owner Author

davidrg commented Jul 22, 2022

This was caused by calling _setmode to set a file caching hint (_O_SEQUENTIAL). As far as I can tell this has never been valid - in Visual C++ 4.2-6 the docs only mention _O_BINARY and _O_TEXT as valid options (the older docs don't seem to mention _O_SEQUENTIAL at all though its present in the headers). In Visual C++ 2022 (and probably all versions going back to 2008) this results in a failed assertion.

Instead the correct method seems to be to supply the 'S' file mode to fopen.

@davidrg davidrg closed this as completed Jul 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant