Skip to content

os: faster os.Root operations where available #73076

@neild

Description

@neild

Most os.Root operations reduce to opening a file within a root, and then performing some action on that file. For example, Root.Open opens a file and returns it, and Root.Mkdir opens the parent directory of its parameter and then creates a directory within it.

The current implementation of opening a file is (hopefully) correct, but it is not fast because it resolves each path component one step at a time to avoid unintended symlink traversal. This is the best we can do (so far as I can tell) within the scope of POSIX file APIs.

However, many platforms do support faster (if non-standard) options. We should use them when available. This is an umbrella issue for doing so. I will create subissues for individual platforms.

Sub-issues

Metadata

Metadata

Assignees

Labels

LibraryProposalIssues describing a requested change to the Go standard library or x/ libraries, but not to a toolNeedsFixThe path to resolution is known, but the work has not been done.Performance

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions