www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 12781] New: process.d: "Executable file not found" is

https://issues.dlang.org/show_bug.cgi?id=12781

          Issue ID: 12781
           Summary: process.d: "Executable file not found" is supposed to
                    show executable name but fails
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: Phobos
          Assignee: nobody puremagic.com
          Reporter: van.de.bugger gmail.com

Look at file phobos/std/process.d line ~360, it is the very beginning of 
function spawnProcessImpl:

    const(char)[] name = args[0];
    if (any!isDirSeparator(name))
    {
        if (!isExecutable(name))
            throw new ProcessException(text("Not an executable 
file: ", name));
    }
    else
    {
        name = searchPathFor(name);
        if (name is null)
            throw new ProcessException(text("Executable file not 
found: ", name));
    }

Look at the "else" clause. If function searchPathFor failed, we 
are throwing an error "Executable file not found: ", which is 
supposed to include name of executable file. But name at this 
moment is null... :-(

--
May 21 2014