Skip to content

unified stdio #12980

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

Merged
merged 1 commit into from
Mar 20, 2014
Merged

unified stdio #12980

merged 1 commit into from
Mar 20, 2014

Conversation

emberian
Copy link
Member

this comes from a discussion on IRC where the split between stdin and stdout
seemed unnatural, and the fact that reading on stdin won't flush stdout, which
is unlike every other language (including C's stdio).

@alexcrichton
Copy link
Member

I don't quite understand why stdout and stdin need to be unified into one object. The existing I/O objects generally represent separate functionality as separate objects. The stdin/stdout file descriptors aren't necessarily a stream, so I'm not sure that they should be connected.

This also seems odd to move the entire stdio module just to make room for one stdio function. I would rather just have StdReader flush the task-local stdout on reads.

@lilyball
Copy link
Contributor

I agree with @alexcrichton. Having reads on stdin flush stdout seems valid, but otherwise, they should be separate objects.

@thestinger
Copy link
Contributor

I don't think it should do implicit flushing when it's not attached to a terminal. Does C stdio really do this?

@emberian
Copy link
Member Author

@thestinger you're right, C stdio only does it when attached to a terminal.

bors added a commit that referenced this pull request Mar 20, 2014
this comes from a discussion on IRC where the split between stdin and stdout
seemed unnatural, and the fact that reading on stdin won't flush stdout, which
is unlike every other language (including C's stdio).
@bors bors closed this Mar 20, 2014
@bors bors merged commit 8fee3f6 into rust-lang:master Mar 20, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants