{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/corefx/issues/25536","repository_url":"https://api.github.com/repos/dotnet/corefx","labels_url":"https://api.github.com/repos/dotnet/corefx/issues/25536/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/corefx/issues/25536/comments","events_url":"https://api.github.com/repos/dotnet/corefx/issues/25536/events","html_url":"https://github.com/dotnet/corefx/issues/25536","id":277235217,"number":25536,"title":"Need Span based path join API","user":{"login":"JeremyKuhne","id":8184940,"avatar_url":"https://avatars3.githubusercontent.com/u/8184940?v=4","gravatar_id":"","url":"https://api.github.com/users/JeremyKuhne","html_url":"https://github.com/JeremyKuhne","followers_url":"https://api.github.com/users/JeremyKuhne/followers","following_url":"https://api.github.com/users/JeremyKuhne/following{/other_user}","gists_url":"https://api.github.com/users/JeremyKuhne/gists{/gist_id}","starred_url":"https://api.github.com/users/JeremyKuhne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JeremyKuhne/subscriptions","organizations_url":"https://api.github.com/users/JeremyKuhne/orgs","repos_url":"https://api.github.com/users/JeremyKuhne/repos","events_url":"https://api.github.com/users/JeremyKuhne/events{/privacy}","received_events_url":"https://api.github.com/users/JeremyKuhne/received_events","type":"User","site_admin":false},"labels":[{"id":165998434,"url":"https://api.github.com/repos/dotnet/corefx/labels/api-ready-for-review","name":"api-ready-for-review","color":"5319e7","default":false},{"id":154422420,"url":"https://api.github.com/repos/dotnet/corefx/labels/area-System.IO","name":"area-System.IO","color":"d4c5f9","default":false}],"state":"open","locked":false,"assignee":{"login":"JeremyKuhne","id":8184940,"avatar_url":"https://avatars3.githubusercontent.com/u/8184940?v=4","gravatar_id":"","url":"https://api.github.com/users/JeremyKuhne","html_url":"https://github.com/JeremyKuhne","followers_url":"https://api.github.com/users/JeremyKuhne/followers","following_url":"https://api.github.com/users/JeremyKuhne/following{/other_user}","gists_url":"https://api.github.com/users/JeremyKuhne/gists{/gist_id}","starred_url":"https://api.github.com/users/JeremyKuhne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JeremyKuhne/subscriptions","organizations_url":"https://api.github.com/users/JeremyKuhne/orgs","repos_url":"https://api.github.com/users/JeremyKuhne/repos","events_url":"https://api.github.com/users/JeremyKuhne/events{/privacy}","received_events_url":"https://api.github.com/users/JeremyKuhne/received_events","type":"User","site_admin":false},"assignees":[{"login":"JeremyKuhne","id":8184940,"avatar_url":"https://avatars3.githubusercontent.com/u/8184940?v=4","gravatar_id":"","url":"https://api.github.com/users/JeremyKuhne","html_url":"https://github.com/JeremyKuhne","followers_url":"https://api.github.com/users/JeremyKuhne/followers","following_url":"https://api.github.com/users/JeremyKuhne/following{/other_user}","gists_url":"https://api.github.com/users/JeremyKuhne/gists{/gist_id}","starred_url":"https://api.github.com/users/JeremyKuhne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JeremyKuhne/subscriptions","organizations_url":"https://api.github.com/users/JeremyKuhne/orgs","repos_url":"https://api.github.com/users/JeremyKuhne/repos","events_url":"https://api.github.com/users/JeremyKuhne/events{/privacy}","received_events_url":"https://api.github.com/users/JeremyKuhne/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/dotnet/corefx/milestones/12","html_url":"https://github.com/dotnet/corefx/milestone/12","labels_url":"https://api.github.com/repos/dotnet/corefx/milestones/12/labels","id":2323293,"number":12,"title":"2.1.0","description":".NET Core 2.1, next major release. See [official release dates](https://github.com/dotnet/core/blob/master/roadmap.md) for details.","creator":{"login":"karelz","id":5776068,"avatar_url":"https://avatars2.githubusercontent.com/u/5776068?v=4","gravatar_id":"","url":"https://api.github.com/users/karelz","html_url":"https://github.com/karelz","followers_url":"https://api.github.com/users/karelz/followers","following_url":"https://api.github.com/users/karelz/following{/other_user}","gists_url":"https://api.github.com/users/karelz/gists{/gist_id}","starred_url":"https://api.github.com/users/karelz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/karelz/subscriptions","organizations_url":"https://api.github.com/users/karelz/orgs","repos_url":"https://api.github.com/users/karelz/repos","events_url":"https://api.github.com/users/karelz/events{/privacy}","received_events_url":"https://api.github.com/users/karelz/received_events","type":"User","site_admin":false},"open_issues":249,"closed_issues":5091,"state":"open","created_at":"2017-02-15T02:14:11Z","updated_at":"2018-02-25T18:43:34Z","due_on":null,"closed_at":null},"comments":7,"created_at":"2017-11-28T02:17:35Z","updated_at":"2018-02-25T19:20:07Z","closed_at":null,"author_association":"MEMBER","body":"We need an API that does a simple join of `ReadOnlySpan<char>` segments, adding a directory separator only if needed.\r\n\r\n\r\n## Rationale and Usage\r\n\r\nWe don't have API for combining paths that works with `Span<char>`. It will become common that segments of existing strings will be combined into paths. A simple example will be getting a filename from an existing path and adding it to the directory of another.\r\n\r\n``` C#\r\n// entry.FileName being a ReadOnlySpan<char>, directory being a string or span\r\nstring path = Path.Join(directory, entry.FileName);\r\n```\r\n\r\nWe could add overloads for `Path.Combine()`, but the behavior of returning the last argument that passes `IsPathRooted()` isn't intuitive, and is not desired in the common case. If the intent was to \"resolve\" a path against another, getting the final path correct is difficult to do, particularly on Windows.  Take the following:\r\n\r\n``` C#\r\nstring result = Path.Combine(@\"C:\\Foo\", @\"\\Bar\");\r\n```\r\n\r\nThis returns `\\Bar`, which can only be correctly resolved (via `Path.GetFullPath()`) if the current directory happens to be on the `C:` drive. This can be better handled by the #25535 proposal for Path.GetFullPath().\r\n\r\nAdditionally, it is common for people to use the existing `Combine()` APIs on paths that aren't file system paths (URIs, registry paths, etc.).\r\n\r\n## Proposed API\r\n\r\n``` C#\r\nnamespace System.IO\r\n{\r\n    public static class Path\r\n    {\r\n        public static string Join(ReadOnlySpan<char> path1, ReadOnlySpan<char> path2);\r\n        public static string Join(ReadOnlySpan<char> path1, ReadOnlySpan<char> path2, ReadOnlySpan<char> path3);\r\n        public static bool TryJoin(Span<char> destination, out int charsWritten, ReadOnlySpan<char> path1, ReadOnlySpan<char> path2);\r\n    }\r\n}\r\n```\r\n\r\n## Implementation Notes\r\n\r\n- We will add the default directory separator if either type of separator is not already present (we'll allow an existing AltDirectorySeparator to be valid)\r\n- Only spans that have a length will be combined\r\n- We will not care about rooting (unlike the existing Combine APIs)\r\n- This will not check the validity of the given paths in any way (character validity, etc)"},"comment":{"url":"https://api.github.com/repos/dotnet/corefx/issues/comments/368336418","html_url":"https://github.com/dotnet/corefx/issues/25536#issuecomment-368336418","issue_url":"https://api.github.com/repos/dotnet/corefx/issues/25536","id":368336418,"user":{"login":"JeremyKuhne","id":8184940,"avatar_url":"https://avatars3.githubusercontent.com/u/8184940?v=4","gravatar_id":"","url":"https://api.github.com/users/JeremyKuhne","html_url":"https://github.com/JeremyKuhne","followers_url":"https://api.github.com/users/JeremyKuhne/followers","following_url":"https://api.github.com/users/JeremyKuhne/following{/other_user}","gists_url":"https://api.github.com/users/JeremyKuhne/gists{/gist_id}","starred_url":"https://api.github.com/users/JeremyKuhne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JeremyKuhne/subscriptions","organizations_url":"https://api.github.com/users/JeremyKuhne/orgs","repos_url":"https://api.github.com/users/JeremyKuhne/repos","events_url":"https://api.github.com/users/JeremyKuhne/events{/privacy}","received_events_url":"https://api.github.com/users/JeremyKuhne/received_events","type":"User","site_admin":false},"created_at":"2018-02-25T19:20:07Z","updated_at":"2018-02-25T19:20:07Z","author_association":"MEMBER","body":"Based on internal discussions the original plan of keeping Combine semantics the same and using Join() is the current POR."}}
{"actor":{"display_login":"JeremyKuhne"}}