-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
fs.readSync & fs.read position argument does not support BigInt #36185
Comments
Also happens w/ |
This is the same behaviour I think this is a reasonable improvement. Though it might be misleading since people may assume I think a fix would be to:
A more elaborate fix would be to try and get reads to work with position > Int32, which would require:
|
Instead of coercing the value to a number, I'd in fact throw an error. That way there's just a single way to do this and the immediate feedback should be fine to let the user handle the coercing on their own or to use a number instead. |
@BridgeAR Shall I work on this? |
Why you gotta go and make my max file size 9 petabytes! 😭 This is so unreasonable 🤬 j/k |
(Removed |
Given that it is perfectly fine to have bigints well within the acceptable range, I'd say that accepting a BigInt should be fine. We can throw a |
if bigint is allowed, would bigdecimal also be allowed if it hypothetically reaches stage 4? |
BigDecimal is currently stage 1, very early in the stage process. I say one bridge at a time. |
Fixes: #36185 PR-URL: #36190 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Zeyu Yang <himself65@outlook.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Fixes: #36185 PR-URL: #36190 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Zeyu Yang <himself65@outlook.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Fixes: #36185 PR-URL: #36190 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Zeyu Yang <himself65@outlook.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Fixes: #36185 PR-URL: #36190 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Zeyu Yang <himself65@outlook.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Fixes: nodejs#36185 PR-URL: nodejs#36190 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Zeyu Yang <himself65@outlook.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
What steps will reproduce the bug?
How often does it reproduce? Is there a required condition?
Everytime.
What is the expected behavior?
It should read from the position in the file, and it will if you use
Number(position)
on a BigInt position.What do you see instead?
The call reads data into the buffer but it begins at position 0 in the file instead of at the position noted in the BigInt.
The text was updated successfully, but these errors were encountered: