peteraritchie / LongPath

drop-in library to support long paths in .NET
GNU Lesser General Public License v3.0
112 stars 43 forks source link

Path.GetDirectoryName is buggy when passed a relative path #66

Open 0x53A opened 7 years ago

0x53A commented 7 years ago

input: ..\..\paket-files\fsharp\FSharp.Data\src\CommonRuntime\TextRuntime.fs

.net: ..\..\paket-files\fsharp\FSharp.Data\src\CommonRuntime LongPath: s\fsharp\FSharp.Data\src\CommonRuntime

0x53A commented 7 years ago

(I will use this issue to post everything I find with regard to my usage in paket, and then try to send a PR at the end.)

Note the build failure here: https://travis-ci.org/fsprojects/Paket/builds/261190855#L2067

Missing mono check with File.ReadAllLines

Error: System.EntryPointNotFoundException: CreateFile at (wrapper managed-to-native) Pri.LongPath.NativeMethods:CreateFile (string,Pri.LongPath.NativeMethods/EFileAccess,uint,intptr,uint,uint,intptr) at Pri.LongPath.File.GetFileHandle (System.String normalizedPath, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.IO.FileOptions options) [0x00010] in <5fe62e72e6b34ffb9606ed60feed6f3f>:0 at Pri.LongPath.File.Open (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.IO.FileOptions options) [0x00011] in <5fe62e72e6b34ffb9606ed60feed6f3f>:0 at Pri.LongPath.File+d__43.MoveNext () [0x0001c] in <5fe62e72e6b34ffb9606ed60feed6f3f>:0 at System.Collections.Generic.LargeArrayBuilder1[T].AddRange (System.Collections.Generic.IEnumerable1[T] items) [0x0005e] in <26aedeede9534b948c539f8734c8492d>:0 at System.Collections.Generic.EnumerableHelpers.ToArray[T] (System.Collections.Generic.IEnumerable1[T] source) [0x00033] in <26aedeede9534b948c539f8734c8492d>:0 at System.Linq.Enumerable.ToArray[TSource] (System.Collections.Generic.IEnumerable1[T] source) [0x00018] in <26aedeede9534b948c539f8734c8492d>:0 at Pri.LongPath.File.ReadAllLines (System.String path, System.Text.Encoding encoding) [0x00007] in <5fe62e72e6b34ffb9606ed60feed6f3f>:0 at Pri.LongPath.File.ReadLines (System.String path) [0x00006] in <5fe62e72e6b34ffb9606ed60feed6f3f>:0 at Pri.LongPath.File.ReadAllLines (System.String path) [0x00000] in <5fe62e72e6b34ffb9606ed60feed6f3f>:0