xonsh.procs.executables

Interfaces to locate executable files on file system.

xonsh.procs.executables.clear_paths(paths)[source]

Remove duplicates and nonexistent directories from paths.

xonsh.procs.executables.get_paths(env=None)[source]

Return tuple with deduplicated and existent paths from $PATH.

xonsh.procs.executables.get_possible_names(name, env=None)[source]

Expand name to all possible variants based on PATHEXT.

PATHEXT is a Windows convention containing extensions to be considered when searching for an executable file.

Conserves order of any extensions found and gives precedence to the bare name.

xonsh.procs.executables.is_executable(filepath)

Check the file is executable in POSIX.

xonsh.procs.executables.is_executable_in_posix(filepath)[source]

Check the file is executable in POSIX.

xonsh.procs.executables.is_executable_in_windows(filepath, env=None)[source]

Check the file is executable in Windows.

xonsh.procs.executables.locate_executable(name, env=None)[source]

Search executable binary name in $PATH and return full path.

xonsh.procs.executables.locate_file(name, env=None, check_executable=False, use_pathext=False)[source]

Search file name in the current working directory and in $PATH and return full path.

xonsh.procs.executables.locate_file_in_path_env(name, env=None, check_executable=False, use_pathext=False)[source]

Search file name in $PATH and return full path.

Compromise. There is no way to get case sensitive file name without listing all files. If the file name is CaMeL.exe and we found that camel.EXE exists there is no way to get back the case sensitive name. We don’t want to read the list of files in all $PATH directories because of performance reasons. So we’re ok to get existent but case insensitive (or different) result from resolver. May be in the future file systems as well as Python Path will be smarter to get the case sensitive name. The task for reading and returning case sensitive filename we give to completer in interactive mode with commands_cache.

xonsh.procs.executables.locate_relative_path(name, env=None, check_executable=False, use_pathext=False)[source]

Return absolute path by relative file path.

We should not locate files without prefix (e.g. "binfile") by security reasons like other shells. If directory has “binfile” it can be called only by providing prefix “./binfile” explicitly.