UweKeim / ZetaLongPaths

A .NET library to access files and directories with more than 260 characters length.

Home Page:https://nuget.org/packages/ZetaLongPaths

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ZlpPath.Combine

MustafaDaoud90 opened this issue · comments

When use ZlpPathHelper.Combine(path1, path2) function not return the same as System.IO.Path.Combine(path1, path2).

For example when use System.IO.Path.Combine(path1, path2):

System.IO.Path.Combine("C:\Users\m.ahmad\AppData\Roaming\MustafaDaoud\MustafaDaoud\Jobs\{6E820F39-1F0F-4C22-A9F6-5E7CAE6F6FA7}\Data\BackupCache\","C:\Users\m.ahmad\AppData\Roaming\MustafaDaoud\MustafaDaoud\Jobs\{6E820F39-1F0F-4C22-A9F6-5E7CAE6F6FA7}\Data\BackupCache\9219909703685094454.pst")

returns this path:
C:\Users\m.ahmad\AppData\Roaming\MustafaDaoud\MustafaDaoud\Jobs{6E820F39-1F0F-4C22-A9F6-5E7CAE6F6FA7}\Data\BackupCache\3948766359955674179.pst

but when use ZlpPathHelper.Combine(path1, path2):

ZlpPathHelper.Combine("C:\Users\m.ahmad\AppData\Roaming\MustafaDaoud\MustafaDaoud\Jobs\{6E820F39-1F0F-4C22-A9F6-5E7CAE6F6FA7}\Data\BackupCache\","C:\Users\m.ahmad\AppData\Roaming\MustafaDaoud\MustafaDaoud\Jobs\{6E820F39-1F0F-4C22-A9F6-5E7CAE6F6FA7}\Data\BackupCache\9219909703685094454.pst")

returns this path:
C:\Users\m.ahmad\AppData\Roaming\MustafaDaoud\MustafaDaoud\Jobs{6E820F39-1F0F-4C22-A9F6-5E7CAE6F6FA7}\Data\BackupCache\C:\Users\m.ahmad\AppData\Roaming\MustafaDaoud\MustafaDaoud\Jobs{6E820F39-1F0F-4C22-A9F6-5E7CAE6F6FA7}\Data\BackupCache\3948766359955674179.pst

please advise.

What would be the reason to combine two absolute paths?

because I want to use it in my project to accept long path and I replace my code from using System.IO.Path to ZlpPathHelper without changing the original code structure, if you can help me.

Thanks for the quick reply.

Still, no matter which library, what is the logical reason to combine two absolute paths?

I need the complete path details to create a new file, starting from the root element and ending with the other subdirectories.

Please I need it urgently, if can you help me.

I do think I have a fix.

Will add more unit tests and release an update later to NuGet.

Thanks a lot, Boss.