UweKeim / ZetaLongPaths

A .NET library to access files and directories with more than 260 characters length.
https://nuget.org/packages/ZetaLongPaths
MIT License
141 stars 28 forks source link

ZlpPath.Combine #39

Closed MustafaDaoud90 closed 2 years ago

MustafaDaoud90 commented 2 years ago

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.

UweKeim commented 2 years ago

What would be the reason to combine two absolute paths?

MustafaDaoud90 commented 2 years ago

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.

UweKeim commented 2 years ago

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

MustafaDaoud90 commented 2 years ago

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

MustafaDaoud90 commented 2 years ago

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

UweKeim commented 2 years ago

I do think I have a fix.

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

MustafaDaoud90 commented 2 years ago

Thanks a lot, Boss.