Skip to content

Allow reading file-based app from stdin #49348

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 7 commits into from
Jun 18, 2025
Merged

Conversation

jjonescz
Copy link
Member

Resolves #49201.

@jjonescz jjonescz requested a review from a team June 12, 2025 15:30
@jjonescz jjonescz marked this pull request as ready for review June 12, 2025 15:30
@jaredpar jaredpar added this to the 10.0.1xx milestone Jun 12, 2025
}

// If '-' is specified as the input file, read all text from stdin into a temporary file and use that as the entry point.
entryPointFilePath = Path.GetTempFileName();
Copy link
Member

Choose a reason for hiding this comment

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

On Unix can't assume that only current user has access to this file path. Don't we need to enforce current user permissions?

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point. It seems that GetTempFileName uses mkstemps which creates the file with 0600 permissions. I'm not sure if all that is guaranteed, but I'd hope it is, I see GetTempFileName used all over the place without any additional code to enforce the unix mode.

@jjonescz jjonescz merged commit e6168d6 into dotnet:main Jun 18, 2025
30 checks passed
@jjonescz jjonescz deleted the sprint-pipe branch June 18, 2025 07:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-run-file Items related to the "dotnet run <file>" effort
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support piping code directly into dotnet run via stdin
5 participants