<div dir="ltr">Although extremely uncommon, it's theoretically possible to have a different system installation directory. Is this not possible on posix platforms? Is it guaranteed that /bin/sh is always the path, no matter what strange things a user might have done to their system?<div><br></div><div>Maybe a better solution is to have RunShellCommand() call Platform::ResolveExecutable.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Oct 14, 2014 at 5:45 PM, Greg Clayton <span dir="ltr"><<a href="mailto:gclayton@apple.com" target="_blank">gclayton@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">As a follow up, the Platform::ResolveExecutable() should be the one to resolve executables and the function call actually shouldn't go on FileSpec.<br>
<span class="im HOEnZb"><br>
> On Oct 14, 2014, at 5:38 PM, Greg Clayton <<a href="mailto:gclayton@apple.com">gclayton@apple.com</a>> wrote:<br>
><br>
><br>
</span><div class="HOEnZb"><div class="h5">>> On Oct 14, 2014, at 4:36 PM, Zachary Turner <<a href="mailto:zturner@google.com">zturner@google.com</a>> wrote:<br>
>><br>
>> I have an issue on Windows when trying to run shell commands. We specify the shell as "cmd.exe", create a FileSpec out of this, and call FileSpec::Resolve. This ends up making an absolute path out of cmd.exe, but it does so by just sticking the working directory onto the front of it, which is obviously wrong.<br>
>><br>
>> My question is: For FileSpecs that are only filenames, nothing else, should we attempt to locate a matching file in PATH, and when we find one use the resulting absolute path?<br>
><br>
> Not by default. We should have a method on FileSpec that might say "ResolveExecutableUsingPath()", but I wouldn't do it by default for every file spec. Not every file is an executable, so we shouldn't treat all files as executables by default unless a method is explicitly called on that.<br>
><br>
> As a side questions, we provide a complete path to "/bin/sh" as the shell for unix, shouldn't we specify a full path to "cmd.exe" as well? Does it live in a known location on windows?<br>
><br>
> Greg<br>
><br>
><br>
</div></div><div class="HOEnZb"><div class="h5">> _______________________________________________<br>
> lldb-dev mailing list<br>
> <a href="mailto:lldb-dev@cs.uiuc.edu">lldb-dev@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev</a><br>
<br>
</div></div></blockquote></div><br></div>