Re: [racket-users] file->bytes with large files

2020-07-17 Thread Greg Rosenblatt
Thanks. Depending on how the increment compares to the file size, file->bytes might be up to 1.5x faster (on my machine at least) than the workaround. But the workaround is still fast enough. (define (file->bytes2 file-name) (define size (file-size file-name)) (define bs (make-bytes

Re: [racket-users] file->bytes with large files

2020-07-15 Thread Matthew Flatt
The `file->bytes` function uses the file size with `read-bytes`, and it appears that the Mac OS `read` system call errors on requests of 2GB or more. The right fix is for the `read` call within Racket (at the rktio layer) to limit the size that it passes, and I'll make that change. Meanwhile, you

[racket-users] file->bytes with large files

2020-07-15 Thread Greg Rosenblatt
Hi, I'm getting an error while using file->bytes to load a moderately large file: > (time (void (file->bytes "my-7.6GB-file"))) ; error reading from stream port ; port: # ; system error: Invalid argument; errno=22 ; context...: ;/Applications/Racket v7.7/collects/racket/file.rkt:768:6: