peteraritchie / LongPath

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

Support UNC paths #9

Closed thomaslevesque closed 8 years ago

thomaslevesque commented 9 years ago

Path.GetPathRoot(@"\\server\foo\bar\baz.txt") should return \\server\foo, but it returns \\ instead

peteraritchie commented 9 years ago

I need to look into UNC support; more than likely a fair amount of work :)

jonathanjones2 commented 9 years ago

Have you decided if you'll be extending support to UNC paths? I'm currently in a situation where I scan shares via the UNC path and I'm running into issues with long paths and filenames.

peteraritchie commented 9 years ago

I believe the latest changes and passing tests mean that UNCs are now supported. I would appreciate if someone could try out some of the issues they've ad with UNCs prior.

Thanks.

FuchsiaSoft commented 9 years ago

@peteraritchie are you still wanting results?... I'm about to use this for a lot of work with UNCs so can let you know how it goes in a week or so?

jonathanjones2 commented 9 years ago

No thanks

JJ On Apr 7, 2015 12:29 PM, "Chris Wilson" notifications@github.com wrote:

@peteraritchie https://github.com/peteraritchie are you still wanting results?... I'm about to use this for a lot of work with UNCs so can let you know how it goes in a week or so?

— Reply to this email directly or view it on GitHub https://github.com/peteraritchie/LongPath/issues/9#issuecomment-90633545 .

FuchsiaSoft commented 9 years ago

JJ I was referencing Peter's comment after yours. Sorry if I was unclear.

peteraritchie commented 9 years ago

@FuchsiaSoft yeah, the code should work now with UNCs; I haven't had the time to get too deep into testing it (moved to a different country :) ). If there's something blocking you, let me know.

idiamant commented 9 years ago

Hi, I am having a problem with the UNC support. I have the following path in a variable: \10.24.0.11\Deployments\Backups\AndroidBuilder

That directory exists, but when checking with Directory.Exists("\10.24.0.11\Deployments\Backups\AndroidBuilder") it doesn't find this path. Then it goes into the next line, which is Directory.CreateDirectory("\10.24.0.11\Deployments\Backups\AndroidBuilder"), and this one fails due to this error: {"The UNC path should be of the form \server\share."}.

Obviously there is lack of UNC support, and I couldn't fully understand why it fails.

Would love to get assistance with this one.

Thanks, Ido

peteraritchie commented 9 years ago

I'm not clear on your question. "\10.24.0.11\Deployments\Backups\AndroidBuilder" is not a valid UNC. UNCs must start with "\", which is what is detailed in the error.

idiamant commented 9 years ago

yea, sorry, it was a wrong Paste. it is \10.24.0.11...

peteraritchie commented 9 years ago

Huh? that's still missing a slash

idiamant commented 9 years ago

ahhhh for some reason github removes double slashes :) its \10.24.0.11\deployments\

enoshixi commented 9 years ago

UNC paths aren't working for me either. I think the problem is that the long path format for UNC paths is a little different... \\server\share should be formatted as \\?\UNC\server\share.

gpetrou commented 9 years ago

Are you planning to check the PR for the UNC paths? Also, are you planning to release a new version?

NeilWhitworth commented 8 years ago

I have been testing with pull request #27 and it does seam to work for long UNC paths. The only issue I has was a path that was exactly MAXPATH in length

peteraritchie commented 8 years ago

@NeilWhitworth What issue did you have with a path that was exactly MAXPATH?

peteraritchie commented 8 years ago

Assuming this is working now