temp_windows.go 381 B

123456789101112131415161718
  1. // +build windows
  2. package ioutils
  3. import (
  4. "io/ioutil"
  5. "github.com/docker/docker/pkg/longpath"
  6. )
  7. // TempDir is the equivalent of ioutil.TempDir, except that the result is in Windows longpath format.
  8. func TempDir(dir, prefix string) (string, error) {
  9. tempDir, err := ioutil.TempDir(dir, prefix)
  10. if err != nil {
  11. return "", err
  12. }
  13. return longpath.AddPrefix(tempDir), nil
  14. }