Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support UNC paths #9

Closed
thomaslevesque opened this issue Sep 21, 2014 · 17 comments
Closed

Support UNC paths #9

thomaslevesque opened this issue Sep 21, 2014 · 17 comments
Assignees

Comments

@thomaslevesque
Copy link
Contributor

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

@peteraritchie
Copy link
Owner

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

@jonathanjones2
Copy link

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 peteraritchie self-assigned this Feb 1, 2015
@peteraritchie peteraritchie changed the title GetPathRoot doesn't work for UNC path Support UNC paths Feb 1, 2015
@peteraritchie
Copy link
Owner

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
Copy link

@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
Copy link

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
#9 (comment)
.

@FuchsiaSoft
Copy link

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

@peteraritchie
Copy link
Owner

@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
Copy link

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
Copy link
Owner

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
Copy link

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

@peteraritchie
Copy link
Owner

Huh? that's still missing a slash

@idiamant
Copy link

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

@enoshixi
Copy link

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
Copy link

gpetrou commented Sep 7, 2015

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

@NeilWhitworth
Copy link

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
Copy link
Owner

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

@peteraritchie
Copy link
Owner

Assuming this is working now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants