Open swift-ci opened 8 years ago
Hm. Int.max
is different from SIZE_MAX
. I wonder if -1 would work, but that still may not be the interface we want for the "Swifty" Dispatch. mww (JIRA User), what do you think?
Comment by Riley Avron (JIRA)
Note that it's possible to get the "until EOF" behavior by passing Int(bitPattern: SIZE_MAX)
. Note too that there was an explicit decision to import size_t
as Int
. I'm not sure where that leaves us in terms of the right API here.
cc ktopley-apple (JIRA User)
Comment by Kim Topley (JIRA)
Probably we should consider adding an explicit API for reading to end of file instead of relying on a particular length.
Comment by Kim Topley (JIRA)
Filed rdar://problem/34663502 to track this issue.
Environment
OSX Xcode 8Additional Detail from JIRA
| | | |------------------|-----------------| |Votes | 1 | |Component/s | libdispatch | |Labels | Bug, SDKOverlay | |Assignee | None | |Priority | Medium | md5: 8a4cf83f85fd0da59a4731c667e0be19Issue Description:
Although the previous iteration of dispatch_io_read() allows you to pass the value SIZE_MAX as the length in order to read the entire file until an EOF character is reached, DispatchIO.read() no longer supports this. Instead giving the value ```Int.max``` leads the channel to wait indefinitely until the max size is available to read.