Skip to content
This repository was archived by the owner on Sep 6, 2021. It is now read-only.
This repository was archived by the owner on Sep 6, 2021. It is now read-only.

Clarify path syntax requirements #3872

@njx

Description

@njx

It's not totally clear when writing code that deals with paths exactly what kind of path is expected, especially on Windows.

From reading through a fair amount of code, it looks like we usually expect native paths on Windows to look like C:/foo/bar/baz.txt. This is a little odd, since it's neither proper URL-syntax (it's not URL-encoded and doesn't start with a slash) nor an actual native path (since it uses forward slashes). That said, it's convenient to work with, so we should clarify somewhere that all internal paths should be in this format on Windows.

It also looks like there's a function FileUtils.convertToNativePath(), which appears intended to take a URL-style path (/C:/foo/bar/baz.txt), URL-decode it, and strip off the leading slash if there is one. This should probably be renamed to convertURLSyntaxToNativePath() or some such.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions