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.
Most
os.Rootoperations reduce to opening a file within a root, and then performing some action on that file. For example,Root.Openopens a file and returns it, andRoot.Mkdiropens 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.