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

read and write issues in windows #8

Open
deadPix3l opened this issue Apr 20, 2018 · 2 comments
Open

read and write issues in windows #8

deadPix3l opened this issue Apr 20, 2018 · 2 comments

Comments

@deadPix3l
Copy link
Owner

This is a reference to the comments made on #7. The windows implementation on python seems to struggle with reading and writing to a file without seeks and flushes separating them. While I was seeking between the read() and write(), I did not between the write() and the next blocks read(). One hacky way to solve this is a seek. Any seek, even if it does nothing, like f.seek(f.tell()) will fix it. Or the more proper way (which will come in a commit fixing this issue soon) is f.flush(). I just wanted to document it.

@byehack
Copy link

byehack commented Jan 16, 2019

This is a reference to the comments made on #7. The windows implementation on python seems to struggle with reading and writing to a file without seeks and flushes separating them. While I was seeking between the read() and write(), I did not between the write() and the next blocks read(). One hacky way to solve this is a seek. Any seek, even if it does nothing, like f.seek(f.tell()) will fix it. Or the more proper way (which will come in a commit fixing this issue soon) is f.flush(). I just wanted to document it.

i think "rb+" mode can help you

@deadPix3l
Copy link
Owner Author

i think "rb+" mode can help you

yea. i have played with this before in other projects and if memory serves, there are platform inconsistencies in how 'b+' is handled. but I may be wrong, that could be fixed, or just not applicable here. Either way, i may get around to fixing this, but this project is not in active development currently.

But if you would like to fix and test it, i would accept a pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants