diff --git a/ioutil2/ioutil.go b/ioutil2/ioutil.go index c99c987..35c0ad3 100644 --- a/ioutil2/ioutil.go +++ b/ioutil2/ioutil.go @@ -13,7 +13,7 @@ import ( // Write file to temp and atomically move when everything else succeeds. func WriteFileAtomic(filename string, data []byte, perm os.FileMode) error { - dir, name := path.Split(filename) + dir, name := path.Dir(filename), path.Base(filename) f, err := ioutil.TempFile(dir, name) if err != nil { return err