"os"
"os/exec"
"path"
- "strconv"
"strings"
"sync"
"syscall"
return os.MkdirAll(pth, os.FileMode(0777))
}
-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))
-}
-
func isModified(cwd, redoDir, tgt string) (bool, string, error) {
fdDep, err := os.Open(path.Join(redoDir, tgt+DepSuffix))
if err != nil {