зеркало из https://github.com/microsoft/docker.git
19 строки
381 B
Go
19 строки
381 B
Go
// +build windows
|
|
|
|
package ioutils
|
|
|
|
import (
|
|
"io/ioutil"
|
|
|
|
"github.com/docker/docker/pkg/longpath"
|
|
)
|
|
|
|
// TempDir is the equivalent of ioutil.TempDir, except that the result is in Windows longpath format.
|
|
func TempDir(dir, prefix string) (string, error) {
|
|
tempDir, err := ioutil.TempDir(dir, prefix)
|
|
if err != nil {
|
|
return "", err
|
|
}
|
|
return longpath.AddPrefix(tempDir), nil
|
|
}
|