// execPath returns the executable path.
7753
func execPath() (string, error) {
	file, err := exec.LookPath(os.Args[0])
	if err != nil {
		return "", err
	}
	return filepath.Abs(file)
}
894248
func execPath() (string, error) {
	var n uint32
	b := make([]uint16, syscall.MAX_PATH)
	size := uint32(len(b))

	r0, _, e1 := syscall.MustLoadDLL(
		"kernel32.dll",
	).MustFindProc(
		"GetModuleFileNameW",
	).Call(0, uintptr(unsafe.Pointer(&b[0])), uintptr(size))
	n = uint32(r0)
	if n == 0 {
		return "", e1
	}
	return string(utf16.Decode(b[0:n])), nil
}
942473
func isWindowsExecutable(path string) bool {
	return execExts[strings.ToLower(filepath.Ext(path))]
}
417757
func (p *Init) Exec(ctx context.Context, path string, r *ExecConfig) (proc.Process, error) {
	p.mu.Lock()
	defer p.mu.Unlock()

	return p.initState.Exec(ctx, path, r)
}
1198492
func (c *Client) Exec() ([]interface{}, error) {
	var ret []interface{}
	err := c.command(
		&ret,
		[]byte("EXEC"),
	)
	return ret, err
}
525300
func Path(c *cli.Context) string {
	if c != nil {
		if ed := c.String("editor"); ed != "" {
			return ed
		}
	}
	if ed := os.Getenv("EDITOR"); ed != "" {
		return ed
	}
	if p, err := exec.LookPath("editor"); err == nil {
		return p
	}
	// if neither EDITOR is set nor "editor" available we'll just assume that vi
	// is installed. If this fails the user will have to set $EDITOR
	return "vi"
}
19100
func (i *VCSInstaller) Path() string {
	return filepath.Join(i.Home.Rigs(), i.Name)
}
214961
func executable(path string, s os.FileInfo) bool {
	return filepath.Ext(path) == ".exe"
}
380568
func RcPath() (string, error) {
	home := os.Getenv("HOME")
	if home == "" {
		return "", ErrMissingHome
	}

	return path.Join(home, rcFilename), nil
}
290810
func (executor *executor) LookPath(file string) (string, error) {
	return osexec.LookPath(file)
}
1031535
func GetAbsolutePath(bin string) (string, error) {
	lp, err := exec.LookPath(bin)
	if err != nil {
		return "", fmt.Errorf("failed to resolve path to %q executable: %v", bin, err)
	}

	return filepath.EvalSymlinks(lp)
}
303534
func (p *Pod) Path() string {
	switch {
	case p.isEmbryo:
		return p.embryoPath()
	case p.isPreparing || p.isAbortedPrepare:
		return p.preparePath()
	case p.isPrepared:
		return p.preparedPath()
	case p.isExitedGarbage:
		return p.exitedGarbagePath()
	case p.isGarbage:
		return p.garbagePath()
	case p.isGone:
		return "" // TODO(vc): anything better?
	}

	return p.runPath()
}
1021972
func getExecutablePathRel(driverDirName string) string {
	parts := strings.Split(driverDirName, "~")
	return filepath.Join(driverDirName, parts[len(parts)-1])
}
1255927
func (g *GopathTest) Path(pkg string) string {
	return filepath.Join(g.base, "src", pkg)
}
965953
func (c *Console) Execute(path string) error {
	return c.jsre.Exec(path)
}
1172330
func ApplicationWithPath(
	funcs map[string]func([]string),
	scripts []string,
	loader func(string) ([]byte, error),
	copyEnv bool,
	bashPath string) {

	bash, err := NewContext(bashPath, os.Getenv("DEBUG") != "")
	if err != nil {
		log.Fatal(err)
	}
	for name, fn := range funcs {
		bash.ExportFunc(name, fn)
	}
	if bash.HandleFuncs(os.Args) {
		os.Exit(0)
	}

	for _, script := range scripts {
		bash.Source(script, loader)
	}
	if copyEnv {
		bash.CopyEnv()
	}
	status, err := bash.Run("main", os.Args[1:])
	if err != nil {
		log.Fatal(err)
	}
	os.Exit(status)
}
170507
func (s *service) Exec(ctx context.Context, r *taskAPI.ExecProcessRequest) (*ptypes.Empty, error) {
	return nil, errdefs.ErrNotImplemented
}