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#read_at limited to Int32 #10032

Closed
Blacksmoke16 opened this issue Dec 5, 2020 · 1 comment · Fixed by #10356
Closed

File#read_at limited to Int32 #10032

Blacksmoke16 opened this issue Dec 5, 2020 · 1 comment · Fixed by #10356
Labels
kind:bug A bug in the code. Does not apply to documentation, specs, etc. topic:stdlib:files

Comments

@Blacksmoke16
Copy link
Member

Currently https://github.com/crystal-lang/crystal/blob/master/src/file/preader.cr#L7's ivars are typed as Int32, this prevents reading a large enough file at points greater than Int32::Max.

Similarly, thoughts on making bytesize be nilable? This would support the use case of "read the remainder of a file starting at offset x" when using https://crystal-lang.org/api/master/File.html#read_at(offset,bytesize,&)-instance-method.

@asterite
Copy link
Member

asterite commented Dec 5, 2020

Yes for the first thing, I don't know about the second one, maybe it's okay.

@straight-shoota straight-shoota added kind:bug A bug in the code. Does not apply to documentation, specs, etc. topic:stdlib:files labels Dec 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:bug A bug in the code. Does not apply to documentation, specs, etc. topic:stdlib:files
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants