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

[SR-2107] LIBDispatch DispatchIO read Max Int not reading until EOF #733

Open
swift-ci opened this issue Jul 18, 2016 · 5 comments
Open

Comments

@swift-ci
Copy link

Previous ID SR-2107
Radar None
Original Reporter sandmman (JIRA User)
Type Bug
Environment

OSX Xcode 8

Additional Detail from JIRA
Votes 1
Component/s libdispatch
Labels Bug, SDKOverlay
Assignee None
Priority Medium

md5: 8a4cf83f85fd0da59a4731c667e0be19

Issue 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.

@belkadan
Copy link

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?

@swift-ci
Copy link
Author

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.

@belkadan
Copy link

cc ktopley-apple (JIRA User)

@swift-ci
Copy link
Author

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.

@swift-ci
Copy link
Author

Comment by Kim Topley (JIRA)

Filed rdar://problem/34663502 to track this issue.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants