Closed
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.
Metadata
Metadata
Assignees
Labels
Area: `std::io`, `std::fs`, `std::net` and `std::path`Category: An issue tracking the progress of sth. like the implementation of an RFCRelevant to the library API team, which will review and decide on the PR/issue.This issue / PR is in PFCP or FCP with a disposition to merge it.The final comment period is finished for this PR / Issue.
Activity