Conversation
…nts as a separate missing directory components via normalizing the provided path
|
r? @clarfonthey rustbot has assigned @clarfonthey. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
Hmm, this is an interesting one. Right now, the behaviour of I think it might be better to simply add a private method like For example, I would expect that some of the prefix-parsing you do for Also, this isn't strictly required for this PR, but, it would be nice to document this semi-weird behaviour on |
Are you referring to cases like
I'm a little bit confused by what you mean here. If I recall correctly, for prefixed components (current implementation), the
I was considering on creating an ACP for this. I know we have a similar unstable function I'm okay with doing a private method like what you suggested, but I think it a FIXME comment could also work here with suggesting that we should have a method that encapsulate the behavior of trimming trailing cur dir instead of relying on |
I can clarify the docs on |
This PR fixes #162243.
I talk about what the problem is in more details within the issue, but essentially when you have trailing cur dir components, e.g.
"/tmp/foo/.", some platforms may fail withmkdiron this path because it could consider "foo" and the "." as two separate missing path components to create instead of normalizing the given path and seeing that "foo" is the only missing directory here (in which casemkdirshould succeed).What this PR does is it normalizes the provided path, so we don't experience this issue on certain platforms whose
mkdirfunction do not normalize the cur dir component away (as all platforms should succeed with"/tmp/foo/."). There's Rust Playground link that @Raniz85 made that demonstrates theNotFounderror occurring on "/tmp/foo/.".