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

Application name 'dpath' conflicts with Windows shell command #5

Open
mjcarman opened this issue Jun 25, 2015 · 5 comments
Open

Application name 'dpath' conflicts with Windows shell command #5

mjcarman opened this issue Jun 25, 2015 · 5 comments

Comments

@mjcarman
Copy link
Contributor

In Windows, the name 'dpath' conflicts with a built-in shell command of the same name.
cf. http://ss64.com/nt/path.html

@renormalist
Copy link
Owner

Haha, funny, "DPATH is an undocumented internal utility" - my naming skills are amazing. :-)

Seriously, can you explain what actually happens with my dpath tool on Windows?
Which one wins, the internal tool or my one? Or does it throw an error when executing or installing it?

Do you have a suggestion what to do about it?

@mjcarman
Copy link
Contributor Author

mjcarman commented Jul 9, 2015

I like the name. Unfortunately, it's hard to avoid colliding with any built-in on any platform; especially esoteric undocumented ones.

App::DPath installs cleanly on Windows once you apply labrown's patch. The test suite invokes dpath as perl -Ilib bin/dpath, which avoids the name conflict.

On Windows, built-in shell commands take precedence over executables of the same name found on the path. In this case it looks like nothing happens when running dpath. There's no error, no output of any kind. What actually happens is that it sets the DPATH environment variable. e.g. Running dpath "/foo/bar" baz.yaml results in the DPATH variable being set to "/foo/bar" baz.yaml.

You can work around the conflict by specifying the path to the script (e.g. C:\Perl\site\bin\dpath.bat or perl C:\Perl\site\bin\dpath) but that's to verbose to be useful. I ended up renaming the script to "ddpath." (I'm not recommending that name; it was just a quick work-around.)

I think the only solution is to use a different name -- at least on Windows.

@renormalist
Copy link
Owner

Resuming while having a break during vacation...

Do you know how to install a script with a different name ("ddpath" or "appdpath") depending on OS? I'm happy to take patches.

Thanks.

@dolmen
Copy link

dolmen commented Aug 3, 2015

@renormalist This requires a .PL file to fill blib/bin/ at build time. See PL_FILES in ExtUtils::MakeMaker.

@karenetheridge
Copy link

can PL_FILES be used to transform EXE_FILES, though?

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

No branches or pull requests

4 participants