Skip to content

Accept open io_device in File stat and query functions - #15907

Open
maennchen wants to merge 1 commit into
elixir-lang:mainfrom
maennchen:jm/file-stat
Open

maennchen wants to merge 1 commit into
elixir-lang:mainfrom
maennchen:jm/file-stat

Conversation

@maennchen

Copy link
Copy Markdown
Member

Extend File.stat/2, File.stat!/2, File.regular?/2, File.dir?/2, and File.exists?/2 to accept an open io_device in addition to a path. This lets callers inspect a handle they already hold and avoids time-of-check to time-of-use races. File.lstat is unchanged because :file.read_link_info does not accept io devices.

Assisted-by: Claude:claude-opus-4-7

Extend File.stat/2, File.stat!/2, File.regular?/2, File.dir?/2, and
File.exists?/2 to accept an open io_device in addition to a path. This
lets callers inspect a handle they already hold and avoids
time-of-check to time-of-use races. File.lstat is unchanged because
:file.read_link_info does not accept io devices.

Assisted-by: Claude:claude-opus-4-7
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.

1 participant