Skip to content

Include closed-device errors in File.stat/2 documentation and spec - #16078

Merged
josevalim merged 1 commit into
elixir-lang:mainfrom
preciz:fix/file-stat-closed-device-spec
Nov 8, 2026
Merged

josevalim merged 1 commit into
elixir-lang:mainfrom
preciz:fix/file-stat-closed-device-spec

Conversation

@preciz

@preciz preciz commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

File.stat/2 accepts IO devices, but its return type omits {:error, :terminated}, which is returned when a PID-based file device has been closed.

Add :terminated to the error reasons, document when this result occurs, and add a test that closes a file device before calling File.stat/2.

Assisted-by: Codex CLI:GPT 6.1 Sol

@josevalim josevalim left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please ignore this comment, just a test!

@josevalim
josevalim merged commit 3efc937 into elixir-lang:main Nov 8, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants