-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-ioArea: `std::io`, `std::fs`, `std::net` and `std::path`Area: `std::io`, `std::fs`, `std::net` and `std::path`C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.disposition-mergeThis issue / PR is in PFCP or FCP with a disposition to merge it.This issue / PR is in PFCP or FCP with a disposition to merge it.finished-final-comment-periodThe final comment period is finished for this PR / Issue.The final comment period is finished for this PR / Issue.
Description
Feature gate: #![feature(absolute_path)]
This is a tracking issue for std::path::absolute
for making relative paths absolute without touching the filesystem. It is a drop-in replacement for std::fs::canonicalize
.
Public API
let absolute = std::path::absolute("foo/./bar")?;
Steps / History
- Implementation:
std::path::absolute
#91673 - Final comment period (FCP)
- Stabilization PR
Unresolved Questions
- on Windows this is currently implemented using
GetFullPathNameW
, which isn't quite a "pure" function (in some special cases, e.g.D:file.txt
, it can use hidden environment variables, set by cmd.exe, to resolve the path's root). - Should we recommend using
absolute(a.join(b))
, wherea
is an alternative current directory to usingstd::env::current_dir
? - Is the avoidance of stripping
..
actually the right call? It does seem consistent with the POSIX docs, but may not be the most intuitive behavior (particularly given that Windows doesn't do that).- I think making the path absolute is inherently a platform-specific function. It can only really work according to the rules of the platform.
pixelcmtd, Nukesor, alexxbb, schneiderfelipe, mickdekkers and 20 morejyn514, balbok0, kkafar, mmvanheusden and schneiderfelipeajeetdsouza, WindSoilder, Nukesor, schneiderfelipe, kkafar and 2 more
Metadata
Metadata
Assignees
Labels
A-ioArea: `std::io`, `std::fs`, `std::net` and `std::path`Area: `std::io`, `std::fs`, `std::net` and `std::path`C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.disposition-mergeThis issue / PR is in PFCP or FCP with a disposition to merge it.This issue / PR is in PFCP or FCP with a disposition to merge it.finished-final-comment-periodThe final comment period is finished for this PR / Issue.The final comment period is finished for this PR / Issue.