{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/coreclr/issues/1104","labels_url":"https://api.github.com/repos/dotnet/coreclr/issues/1104/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/coreclr/issues/1104/comments","events_url":"https://api.github.com/repos/dotnet/coreclr/issues/1104/events","html_url":"https://github.com/dotnet/coreclr/issues/1104","id":85566279,"number":1104,"title":"Path.GetFileName does not correctly handle file names with : character","user":{"login":"Haacked","id":19977,"avatar_url":"https://avatars.githubusercontent.com/u/19977?v=3","gravatar_id":"","url":"https://api.github.com/users/Haacked","html_url":"https://github.com/Haacked","followers_url":"https://api.github.com/users/Haacked/followers","following_url":"https://api.github.com/users/Haacked/following{/other_user}","gists_url":"https://api.github.com/users/Haacked/gists{/gist_id}","starred_url":"https://api.github.com/users/Haacked/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Haacked/subscriptions","organizations_url":"https://api.github.com/users/Haacked/orgs","repos_url":"https://api.github.com/users/Haacked/repos","events_url":"https://api.github.com/users/Haacked/events{/privacy}","received_events_url":"https://api.github.com/users/Haacked/received_events","type":"User","site_admin":true},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-06-05T15:58:10Z","updated_at":"2015-06-11T06:17:55Z","closed_at":null,"body":"On my machine, I added the following line to [this test](https://github.com/dotnet/corefx/blob/master/src/System.Runtime.Extensions/tests/System/IO/Path.cs#L48).\r\n\r\n```csharp\r\nAssert.Equal(\"file:name.exe\", Path.GetFileName(Path.Combine(\"bar\", \"baz\", \"file:name.exe\")));\r\n```\r\n\r\nThat test fails because `Path.GetFileName(Path.Combine(\"bar\", \"baz\", \"file:name.exe\"))` returns \"name.exe\".\r\n\r\nThat doesn't seem to be the correct behavior on any platform.\r\n\r\nI'd expect this to either throw an exception (as it would in the case of \"file|name.exe\") OR I'd expect this to return \"file:name.exe\" since `:` is an allowed character in file names on Unix systems. Given the cross-platform goals of CoreFx, I assume the latter behavior is correct?\r\n\r\nOf course, there's the tricky aspect of HFS+ supporting `:` as a path separator, but from my understanding, that's a legacy detail. APIs are supposed to accept `/` as a directory separator and the underlying system translates it to `:`, so I *think* that assuming `:` is not a directory separator is fine.\r\n\r\n_As an aside, I originally opened this over at https://github.com/dotnet/corefx/issues/1934. I couldn't find any unit tests of `Path.cs` in this project. I'm not sure what I'm doing wrong._"},"comment":{"url":"https://api.github.com/repos/dotnet/coreclr/issues/comments/111012057","html_url":"https://github.com/dotnet/coreclr/issues/1104#issuecomment-111012057","issue_url":"https://api.github.com/repos/dotnet/coreclr/issues/1104","id":111012057,"user":{"login":"jasonwilliams200OK","id":2031765,"avatar_url":"https://avatars.githubusercontent.com/u/2031765?v=3","gravatar_id":"","url":"https://api.github.com/users/jasonwilliams200OK","html_url":"https://github.com/jasonwilliams200OK","followers_url":"https://api.github.com/users/jasonwilliams200OK/followers","following_url":"https://api.github.com/users/jasonwilliams200OK/following{/other_user}","gists_url":"https://api.github.com/users/jasonwilliams200OK/gists{/gist_id}","starred_url":"https://api.github.com/users/jasonwilliams200OK/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jasonwilliams200OK/subscriptions","organizations_url":"https://api.github.com/users/jasonwilliams200OK/orgs","repos_url":"https://api.github.com/users/jasonwilliams200OK/repos","events_url":"https://api.github.com/users/jasonwilliams200OK/events{/privacy}","received_events_url":"https://api.github.com/users/jasonwilliams200OK/received_events","type":"User","site_admin":false},"created_at":"2015-06-11T06:17:55Z","updated_at":"2015-06-11T06:17:55Z","body":">  Path.GetFileName2(...)  :trollface: \r\n\r\nOr `Path.GetFileName(..., bool generousMode = false)` :smiley_cat: "}}