github.com/demonoid81/moby@v0.0.0-20200517203328-62dd8e17c460/pkg/ioutils/temp_windows.go (about) 1 package ioutils // import "github.com/demonoid81/moby/pkg/ioutils" 2 3 import ( 4 "io/ioutil" 5 6 "github.com/demonoid81/moby/pkg/longpath" 7 ) 8 9 // TempDir is the equivalent of ioutil.TempDir, except that the result is in Windows longpath format. 10 func TempDir(dir, prefix string) (string, error) { 11 tempDir, err := ioutil.TempDir(dir, prefix) 12 if err != nil { 13 return "", err 14 } 15 return longpath.AddPrefix(tempDir), nil 16 }