X-Git-Url: http://www.git.cypherpunks.ru/?a=blobdiff_plain;f=run.go;h=e40ad1d5d5e4b65a262ea385b4a0e10df3274fa6;hb=d3e2eb3b4a6461c9ab10bc326a5fff4d42f84a03;hp=6a38d5abdf7b735e15beb7023ae43d459cf3e2d3;hpb=a001f12e6aaf4ea0b068028a95c188af1f7925e9;p=goredo.git diff --git a/run.go b/run.go index 6a38d5a..e40ad1d 100644 --- a/run.go +++ b/run.go @@ -29,7 +29,6 @@ import ( "os" "os/exec" "path" - "strconv" "strings" "sync" "syscall" @@ -102,16 +101,6 @@ func mkdirs(pth string) error { 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 {