filepath icon indicating copy to clipboard operation
filepath copied to clipboard

Make extension methods ignore drives

Open ndmitchell opened this issue 11 years ago • 4 comments

In the Windows version of the API, "//foo" <.> "txt" == "//foo\\.txt". That's not what anyone expects, and doesn't match the .NET conventions for filepaths. It also means Shake can't use the <.> FilePath operator with its file globbing syntax as per https://github.com/ndmitchell/shake/issues/198 (which isn't super important, but does hint it might be desirable to change).

My thoughts are the extension of a filepath should be the bit after both the final pathSeparator and final . character. That's a simple definition, consistent with the Posix version, and only changes things in the not-a-complete-UNC-path case, which isn't really a valid FilePath anyway. Plus it probably matches what everyone thinks the operator does anyway.

I have a slight concern here that I might be biased towards doing something that makes it easier for Shake, but is ultimately the wrong thing to do, since I've spent a lot of time on Shake. If anyone else thinks I'm wrong, or even right, please yell.

ndmitchell avatar Nov 30 '14 20:11 ndmitchell