Skip to content

Add symbolic names for standard file descriptors #21

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
Feb 6, 2021

Conversation

lorentey
Copy link
Member

@lorentey lorentey commented Feb 6, 2021

These let us easily read/write data to/from stdin/stdout/stderr without resorting to FileDescriptor(rawValue: 1).

var greeting = "Hello, world!\n"
try greeting.withUTF8 { buffer in
  _ = try FileDescriptor.standardOutput.writeAll(buffer)
}

@lorentey lorentey requested a review from milseman February 6, 2021 03:44
Copy link
Contributor

@milseman milseman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@milseman milseman merged commit 47da6f1 into apple:main Feb 6, 2021
@milseman milseman mentioned this pull request Feb 15, 2021
@lorentey lorentey mentioned this pull request Feb 24, 2021
etcwilde pushed a commit to etcwilde/swift-system that referenced this pull request May 13, 2025
…le#21)

* Add the @discardableResult attribute to OrderedSet.insert(_:at:). Fixes apple#19

* Add the @discardableResult attribute to OrderedSet.updateOrAppend(_).

* Add the @discardableResult attribute to OrderedSet.updateOrInsert(_:at:).
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.

3 participants