GithubHelp home page GithubHelp logo

Comments (9)

pjf avatar pjf commented on August 27, 2024

Smylers, you fabulous and amazing person! You have excellent timing!

Which version of Windows are you using? It looks like cmd changed its behaviour at some point, and I think I have a fix, but I would love a tester. :)

(Let me now get said fix into git to see if it helps.)

~ Paul

from ipc-system-simple.

Smylers avatar Smylers commented on August 27, 2024

Windows 7 — sorry, should've thought to include that

from ipc-system-simple.

pjf avatar pjf commented on August 27, 2024

Patch applied! Any chance you can test what's currently in git (with 1d99f77 applied), or this tarball (which is the same, but already built so there's not futzing with dzil).

Many, many thanks!

from ipc-system-simple.

Smylers avatar Smylers commented on August 27, 2024

Unfortunately that doesn't help: I get the same behaviour as with 1.25.

from ipc-system-simple.

pjf avatar pjf commented on August 27, 2024

Ah, because we have spaces in our argument, and not our command. Creating commands on Windows is tricky, because one can't pass in individual arguments, one passes a "command line" to Win32::Process::Create().

I feel this should just be a matter getting ISS to add quotes to its arguments, but I've got a sinking suspicion that's obvious, simple, and wrong. I have a bit of a gotcha here in that I don't presently have easy access to a Windows machine.

Does running cmd /C start /D C:\Program Files . directly in the Windows shell do the right thing, or does it come up with the same error? (I'd expect one would need to quote C:\Program Files)

Now digging into the Perl core to see how it's done there, although since it's 2am localtime I may not have anything to report tonight.

from ipc-system-simple.

Smylers avatar Smylers commented on August 27, 2024

Correct, the quotes are needed at the Windows shell.

And indeed sticking quotes into the argument passed to system does work (both core's and yours). But it feels icky to have to put quotes into an argument that's documented as not being passed to the shell — and I wasn't confident I knew how to quote the name correctly in the general case.

I'm not sure what the International Space Station has to do with anything, but my Windows knowledge is flaky, and nothing would surprise me at this stage.

Incidentally, the reason I'm opening Explorer in such a convoluted way in the first place is because a simple explorer $dir opens a new window each time (which irritates users), whereas if there's already an Explorer window open on $dir, start $dir will just switch to it. But start isn't a program, it's a built-in command in cmd, hence the need to wrap it. And, astonishingly, start "$dir" fails if $dir contains a space! (No error message, but it just opens another Command Prompt window.) However, that limitation doesn't apply to its /D option, so telling it to start to start in $dir and then open . actually does what's required, despite seeming like at least 2 levels of overkill. I can no longer remember what possessed me to try it.

Good luck.

from ipc-system-simple.

Smylers avatar Smylers commented on August 27, 2024

It turns out that the built-in system may be buggy on Windows: this recent Perl 5 ticket includes a discussion in which there seems to be general agreement that it's argument-splitting isn't quite right: https://rt.perl.org/Public/Bug/Display.html?id=121283#txn-1282174

There's no suggestion of a fix yet, but it seems possible that system's behaviour on Windows may change.

So it may not be worth making IPC::System::Simple compatible with its current behaviour — especially if it turns out that what IPC::System::Simple currently does it what built-in system will be switching to.

from ipc-system-simple.

glasswalk3r avatar glasswalk3r commented on August 27, 2024

Just step into this issue because I was searching for a solution for the same problem but with IPC::Run module.
The think is that putting the command line with spaces between double quotes and submitting it to run through IPC::Open3 works as expected.

from ipc-system-simple.

jkeenan avatar jkeenan commented on August 27, 2024

I believe that this issue may be resolved in IPC-System-Simple version 1.30, just released to CPAN. Can you confirm?

Thank you very much.
Jim Keenan

from ipc-system-simple.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.