
Today I ran into an unexpected limitation of Swift’s FileDescriptor
on macOS (it might also exist on other platforms): Despite the API being full of 64-bit support, in the end it calls down to POSIX read()
, and that gets upset if you request more than 2^31-1 bytes of data in one read.
Since I’m working on code that needs to process 11 GB image files, it’s not unreasonable to want to read more than that.