]> Cypherpunks repositories - gostls13.git/commitdiff
this time really clean up a TODO
authorRob Pike <r@golang.org>
Mon, 3 Aug 2009 22:27:15 +0000 (15:27 -0700)
committerRob Pike <r@golang.org>
Mon, 3 Aug 2009 22:27:15 +0000 (15:27 -0700)
R=rsc
DELTA=28  (0 added, 20 deleted, 8 changed)
OCL=32676
CL=32684

src/cmd/gobuild/util.go

index 3f38cc6986f660a3d393de8fe6007b569e089f32..55ce1398d81136dc3db26be3aacf6a243e11ee80 100644 (file)
@@ -264,36 +264,16 @@ func SourceFiles(dir string) ([]string, os.Error) {
        return out, nil;
 }
 
-// TODO(rsc): Implement these for real as
-// os.MkdirAll and os.RemoveAll and then
-// make these wrappers that call fatal on error.
-
 func MkdirAll(name string) {
-       p, err := exec.Run("/bin/mkdir", []string{"mkdir", "-p", name}, os.Environ(), exec.DevNull, exec.PassThrough, exec.PassThrough);
+       err := path.MkdirAll(name);
        if err != nil {
-               fatal("run /bin/mkdir: %v", err);
-       }
-       w, err1 := p.Wait(0);
-       if err1 != nil {
-               fatal("wait /bin/mkdir: %v", err);
-       }
-       if !w.Exited() || w.ExitStatus() != 0 {
-               fatal("/bin/mkdir: %v", w);
+               fatal("MkdirAll: %v", err);
        }
 }
 
 func RemoveAll(name string) {
-       p, err := exec.Run("/bin/rm", []string{"rm", "-rf", name}, os.Environ(), exec.DevNull, exec.PassThrough, exec.PassThrough);
-       if err != nil {
-               fatal("run /bin/rm: %v", err);
-       }
-       w, err := p.Wait(0);
+       err := path.RemoveAll(name);
        if err != nil {
-               fatal("wait /bin/rm: %v", err);
-       }
-       if !w.Exited() || w.ExitStatus() != 0 {
-               fatal("/bin/rm: %v", w);
+               fatal("RemoveAll: %v", err);
        }
-
 }
-