-
Notifications
You must be signed in to change notification settings - Fork 34
FilePosition restricts random access to 2GB #37
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
Comments
Pull request #38 feels like a clutch. What I really want is
All of that either in the existing modules or in new ones. |
Sounds good, but what does 'the buffers are large' mean? |
"buffers are large" = a Buffer from Node.Buffer.Large - i.e. all offsets, lengths and so on are numbers. The mixed API just makes you convert hither and from all the time, not my idea of fun. |
Ah of course, yes. |
My immediate need for this is gone, but medium term I plan to fork those 3 projects and publish "-large" variants. If somebody else beats me to it, that would be even better; and I'll be happy to hand over the projects to purescript-node or whatever. But I don't think I'll try to land 3 large patches in 3 different projects 😱 |
FilePosition is a newtyped Int, so there is no random access > 2G with the purscript API.
Node.js can do this just fine - node.js numbers are safe to use as integers up to 53 bits.
Making FilePosition a Number would work but I don't like seeing offsets with a decimal point. I used Data.Int53 in my workaround module.
It could be argued that buffer lengths, offsets and bytecounts should be Int53s too. But these are all breaking changes and I can live with doing IO in chunks < 2GB.
The text was updated successfully, but these errors were encountered: