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

mio file_size is incorrect #83

Open
spudwa opened this issue Feb 28, 2022 · 0 comments
Open

mio file_size is incorrect #83

spudwa opened this issue Feb 28, 2022 · 0 comments

Comments

@spudwa
Copy link

spudwa commented Feb 28, 2022

I'm writing a large binary file with a struct/record size of 93k and at regular intervals I want to sort the tail of the file (1500 records) To speed up loading/sorting/writing I thought mmap could be the answer rather than fread() sort fwrite but I'm having a problem caused by Windows GetFileSizeEx() (I think) The following article explains why this may be happening

https://devblogs.microsoft.com/oldnewthing/20111226-00/?p=8813

I'm explicitly giving offset and length to the ctor but the error check fails and if I default the length argument the "wrong" file length is used.

As your documentation says mio can be used for shared access, this seems like a problem

Works fine without the check. I guess it's a case of whether you trust the input or not??? If input parameters are explicit who do you believe?

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

1 participant