ipc-system-simple
ipc-system-simple copied to clipboard
Multi-argument run() fails on Windows when first parameter is a full path that contains spaces
Tests 1 and 2 below fail, but 3 and 4 work. The third one isn't great, because it makes me responsible for properly quoting the entire command. The fourth one isn't great either, because the thing we want to run might not be in the PATH
.
use strict;
use warnings;
use Data::Dumper;
use IPC::System::Simple qw(run);
my @tests = (
['C:\Program Files\TortoiseSVN\bin\svn.exe', 'help'],
['"C:\Program Files\TortoiseSVN\bin\svn.exe"', 'help'],
['"C:\Program Files\TortoiseSVN\bin\svn.exe" help'],
['svn', 'help'],
);
for (@tests) {
print "Running with run(): ", Dumper($_), "\n";
eval {
run(@$_);
};
if ($@) {
print "Error: [$@]\n";
}
}
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
Sorry, I can’t test because l no longer have access to a Windows machine.
I ran into this error, and after upgrading to the latest version, it appears to work as expected.
Using git instead of svn, test cases 1, 3 and 4 pass.
Test case 2 fails (as expected), presumably due to being both manually and automatically quoted.