-
-
Notifications
You must be signed in to change notification settings - Fork 480
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
Issue with UNC paths on Windows #74
Comments
Yes, I've run into this problem too. The readme states to only use forward slashes on Windows, but I'm wondering what the reasoning behind that restriction is. Is there any fundamental problem that prevents implementing support for UNC paths? |
@treet To be honest, I haven't had time to ramp up on |
As a workaround I've used: path = require('path');
glob.sync(filename).map(function (item) {
return path.resolve(item);
}); Example: https://github.com/tuxracer/stylus-import-tree/blob/master/src/index.coffee |
i have the same problem. |
Wildcards that now work: \\host\directory\* Wildcards that still don't work: \\host\* Fixes isaacs#74
Have a look at this pull request, which purports to implement decent UNC path handling. That can probably be improved, but, alas, I couldn't figure out a quick way to do it, because |
I looked into it a bit more, and found another reason why
|
Wildcards that now work: \\host\directory\* Wildcards that still don't work: \\host\* Fixes isaacs#74
Updated the PR to work with v4.2. I can change it further if you |
Sorry for the delay, I've been meaning to get to this, and hoped that I would over the thanksgiving holiday, but it slipped. I'll try to land this week. Thanks for your patience. |
Don't worry about rebasing on master, I think the patch should land pretty cleanly, and it's relatively simple, so it shouldn't be too hard for me to pull forward if necessary. |
Wildcards that now work: \\host\directory\* Wildcards that still don't work: \\host\* Fixes isaacs#74 and isaacs#123
No problem. I was thinking a bit about #123, though, and I realized that they have roughly the same solution, so here's a modified pull request that should fix the other issue as well (basically I just replaced |
This is keeping me from being able to use grunt-contrib-config to copy files from a network file share w/o first having to map the drive in Windows. |
Wildcards that now work: \\host\directory\* Wildcards that still don't work: \\host\* Fixes isaacs#74 and isaacs#123
Ah, just ran into this one as well. I can confirm that @staticshock's fix appears to work. @isaacs just a friendly reminder in-case this one has falling off your radar. |
@stefanpenner et al: See #146. I need a test that passes with the patch, and doesn't pass without the patch. Nothing can be landed in this library with a valid test. I'm sorry for being so strict about this, but it's the only thing that makes maintenance of this module even remotely possible. |
I absolutely agree, good coverage is paramount. I was sending the ping, not to merge, but to make sure you had not forgotten the issue in the first place. As there may have been a small chance you have time to address your own concerns. I suspect based on the comment you do not. Although I have a work-around, I would prefer to not have to play wack-a-mole going forward. So let me see if I can nail down that test case for you this afternoon. |
I've already submitted a test case that works on Windows, and haven't really had any time to look at it since then. So if you tackle this, make sure your approach meets @isaacs's "must run on linux" criterion. |
@isaacs ah, it seems like this library should actually be run on a windows CI as well. What are your thoughts on this? I will gladly do the work to make it run on appveyor. But, If it must provide "full coverage" on *nix, I can also dig in. Although doing it elegantly might require some more refactoring. |
Yes, the test needs to run on Unix (mostly so I don't inadvertently destroy it some day, which I probably will otherwise). Windows CI would be awesome, and I'd greatly appreciate getting this module running somewhere. But it's not a replacement for a test that runs on Unix. |
proposed resolution:
c/d ? |
Yes, plus one, would merge. I suggest hijacking or mocking whatever is necessary to make the patch in #146 testable on unix. That's actually all that's missing from getting to UNC support; appveyor is optional. |
If memory serves a mixture of UNC and My PR (although some more massaging needed) even without the @isaacs would you be alright with improved UNC support being merged, but leaving some scenarios related to Although not ideal, it would likely fix most users problems, without introducing any known regressions. |
Wildcards that now work: \\host\directory\* Wildcards that still don't work: \\host\* [fixes isaacs#74, isaacs#123, isaacs#146] handle UNC paths on win32 credit to @staticshock for the WinPath work
has anyone explored require('path').normalize? from looking at the path.js source it looks like a lot of cross-platform work has been done and it supports UNC. i'm doing and there is cygwin paths which might be worth exploring? |
Any updates on this issue? Facing the same issue. Thx. |
Another user stung by the UNC issue. Is there a temporary work around for this issue? Any assistance is greatly appreciated. Thank you. |
Any updates on this issue? Facing the same issue. Thx. |
Wildcards that now work: \\host\directory\* Wildcards that still don't work: \\host\* Fixes isaacs#74 and isaacs#123
Wildcards that now work: \\host\directory\* Wildcards that still don't work: \\host\* Fixes isaacs#74 and isaacs#123
Is this "simply" a case of passing the right path to the OS or is it more complicated in that you need some NFS specific code for node's |
Late to this party... Having this issue on a Win10 node trying to access/scan a NAS like '\\host\my_media\**\*'. |
@mpaland The party's not over :) |
@pste solution works with Windows drive letters as well ( |
I'm not using Not really familiar with the code, but after a quick look, could the problem be in the |
Not sure what I did wrong last week, but the |
EDIT: My bad :) I misplaced the sharedFolder so it's Tried PS: Only one folder is shared in the |
This works for me, but seems to be far less performant than the initial method (so much so that it's not viable in my application sadly). |
UNC paths are first class citizens now in v9. Only took 10 years to fix this bug 😬 |
When a UNC path is provided as part of the pattern to match, it is incorrectly transformed to an invalid path on the local computer.
e.x.
\\nas\node\
incorrectly becomes/nas/node
which is treated asC:\nas\node\
.The text was updated successfully, but these errors were encountered: