-func tempsuffix() string {
- return strconv.FormatInt((time.Now().UnixNano()+int64(os.Getpid()))&0xFFFFFFFF, 16)
-}
-
-func tempfile(dir, prefix string) (*os.File, error) {
- // It respects umask, unlike ioutil.TempFile
- name := path.Join(dir, TmpPrefix+prefix+"."+tempsuffix())
- return os.OpenFile(name, os.O_RDWR|os.O_CREATE|os.O_EXCL, os.FileMode(0666))
-}
-