Closed
Description
Path::parent
returns Some("")
for relative paths like foo.txt
, but read_dir
throws an error when given ""
, so code like if let Some(parent) = path.parent() { std::fs::read_dir(parent) }
fails for files in the working directory.
Additionally, calling read_dir
on a relative file without a ./
prefix returns file paths without ./
prefixes, but there is no way to achieve similar behavior for the working directory because read_dir("")
throws an error. read_dir(".")
returns file paths with ./
prefixes and is not a solution.
This was tested on Unix, and may be Unix-specific, but I lack a Windows machine to easily test against.
Metadata
Assignees
Labels
Area: `std::io`, `std::fs`, `std::net` and `std::path`Status: Awaiting decision from the relevant subteam (see the T-<team> label).Relevant to the library API team, which will review and decide on the PR/issue.This PR / issue is in PFCP or FCP with a disposition to close it.The final comment period is finished for this PR / Issue.