findExecutable - multiple declarations

Function findExecutable

Find executable by fileName in the paths.

Prototype

string findExecutable(Paths, Exts)(
  string fileName,
  Paths paths,
  Exts extensions
)
if (isInputRange!Paths && is(ElementType!Paths : string) && isInputRange!Exts && is(ElementType!Exts : string));

Returns

Absolute path to the existing executable file or an empty string if not found.

Parameters

NameDescription
fileName Name of executable to search. Should be base name or absolute path. Relative paths will not work. If it's an absolute path, this function does not try to append extensions.
paths Range of directories where executable should be searched.
extensions Range of extensions to append during searching if fileName does not have extension.

Note

Currently it does not check if current user really have permission to execute the file on Windows.

See Also

binPaths, executableExtensions

Function findExecutable

ditto, but on Windows when fileName extension is omitted, executable extensions are appended during search.

Prototype

string findExecutable(Paths)(
  string fileName,
  Paths paths
)
if (isInputRange!Paths && is(ElementType!Paths : string));

See Also

binPaths, executableExtensions

Function findExecutable

ditto, but searches in system paths, determined by PATH environment variable. On Windows when fileName extension is omitted, executable extensions are appended during search.

Prototype

string findExecutable(
  string fileName
) nothrow @trusted;

See Also

binPaths, executableExtensions

Authors

Roman Chistokhodov

Copyright

Roman Chistokhodov 2016

License

Boost License 1.0.