This is what I tried:
package main
import (
"fmt"
"os/exec"
)
func main() {
fmt.Println("Removing build directory")
if err := exec.Command("cmd", "/S /Q", "RD", "c:\\build").Run(); err != nil {
fmt.Printf("Error removing build directory: %s\n", err)
}
if err := exec.Command("cmd", "/C", "mkdir", "c:\\build").Run(); err != nil {
fmt.Printf("Error making new build directory: %s\n", err)
}
}And my output is:
Removing build directory
Error making new build directory: exit status 1So I don't get any error when removing, but it doesn't delete anything. If I do this from command prompt: rd /s /q c:\\build, it works ok.
Why is that ?
--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.