// Returns the full path of the temp file for this TempFileProc.
481519
func (p *TempFileProc) FullPath() string {
	return filepath.Join(p.Dir, p.Name)
}
186512
func getPathFromFileNotFound(err error) (string, error) {
	if soap.IsSoapFault(err) {
		fault := soap.ToSoapFault(err)
		f, ok := fault.VimFault().(types.FileNotFound)
		if !ok {
			return "", fmt.Errorf("%v is not a FileNotFound error", err)
		}
		return f.File, nil
	}
	return "", fmt.Errorf("%v is not a soap fault", err)
}
1341999
func TempPath(tempDir string, prefix string) string {
	if tempDir == "" {
		tempDir = os.TempDir()
	}
	filename, err := RandomID(prefix)
	if err != nil {
		// We had an error getting random bytes, we'll use current nanoseconds
		filename = fmt.Sprintf("%s%d", prefix, time.Now().UnixNano())
	}
	path := filepath.Join(tempDir, filename)
	return path
}
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)
}
874257
func WriteTempFile(prefix string, data []byte, mode os.FileMode) (string, error) {
	path := TempPath("", prefix)
	if err := ioutil.WriteFile(path, data, mode); err != nil {
		return "", err
	}
	return path, nil
}
855879
func TempFile(stream io.ReadCloser) (string, error) {
	f, err := ioutil.TempFile(os.TempDir(), "")
	if err != nil {
		return "", err
	}
	defer f.Close()
	defer stream.Close()

	_, err = io.Copy(f, stream)
	return f.Name(), err
}
502682
func (n *roFileVersion) fullPath() string {
	if n == nil {
		return ""
	}
	return filepath.Join(n.parent.fullPath(), n.name)
}
170154
func GetHomePath() string {
	if runtime.GOOS == "windows" {
		return os.Getenv("HOMEDRIVE") + os.Getenv("HOMEPATH")
	}
	return os.Getenv("HOME")
}
129985
func (f *FileName) Path() string {
	cp := strings.Split(f.Name, "\x00")

	if len(cp) == 0 || cp[0] != serverPolicyRootShareName {
		return "" // TODO: not happening until if/when we handle Windows shares
	}

	cp[0] = ""

	return strings.Join(cp, "/")
}
793901
func (fs *fakeFs) TempDir(dir, prefix string) (string, error) {
	return fs.a.TempDir(dir, prefix)
}
63903
func TempDir(prefix string) (path string, err error) {
	// Create temp file
	var f *os.File
	if f, err = ioutil.TempFile(os.TempDir(), prefix); err != nil {
		err = errors.Wrap(err, "creating temporary file failed")
		return
	}
	path = f.Name()

	// Close temp file
	if err = f.Close(); err != nil {
		err = errors.Wrapf(err, "closing file %s failed", path)
		return
	}

	// Delete temp file
	if err = os.Remove(path); err != nil {
		err = errors.Wrapf(err, "removing %s failed", path)
		return
	}

	// Create temp dir
	if err = os.MkdirAll(path, 0755); err != nil {
		err = errors.Wrapf(err, "mkdirall of %s failed", path)
		return
	}
	return
}
342683
func Path() (string, error) {
	var buflen C.uint32_t = 1024
	buf := make([]C.char, buflen)

	ret := C._NSGetExecutablePath(&buf[0], &buflen)
	if ret == -1 {
		buf = make([]C.char, buflen)
		C._NSGetExecutablePath(&buf[0], &buflen)
	}
	return C.GoString(&buf[0]), nil
}
285992
func (p *TempFileProc) Remove() error {
	// only remove the directory if it is a subdir of the default temp dir.
	if p.Dir != os.TempDir() {
		os.RemoveAll(p.Dir)
	}
	// otherwise just remove the file
	return os.RemoveAll(p.FullPath())
}
54450
private String getTempFilePath(File eFile) {
        String pathStr = this.tempPath + File.separator + eFile.getName() + ".tmp";

        for (int i = 1; i < 5; ++i) {
            File f = new File(pathStr);

            if (!f.exists()) {
                break;
            }

            pathStr = this.tempPath + File.separator + eFile.getName() + "-" + i + ".tmp";
        }

        return pathStr;
    }
1369261
func TempPath(parserName string) string {
	return filepath.Join(os.TempDir(), parserName+archExt)
}
572508
func CopyInfoStatPath(path string, mustExist bool) (CopyInfo, error) {
	pathInfo := CopyInfo{Path: path}

	fileInfo, err := os.Lstat(path)

	if err == nil {
		pathInfo.Exists, pathInfo.IsDir = true, fileInfo.IsDir()
	} else if os.IsNotExist(err) && !mustExist {
		err = nil
	}

	return pathInfo, err
}
809918
func GetTempDir(subPath string, fs afero.Fs) string {
	return afero.GetTempDir(fs, subPath)
}