Closed
Description
On Go 1.13.5 on Windows 2008 R2, running os.RemoveAll on a directory that contains a path longer than 260 characters hangs.
In the following repro, the directory is created, and then the program hangs on os.RemoveAll.
package main
import (
"log"
"os"
"path/filepath"
)
func main() {
// make a long path
a := ""
b := ""
for i := 0; i < 150; i++ {
a += "a"
b += "b"
}
wd, err := os.Getwd()
if err != nil {
log.Fatal(err)
}
err = os.MkdirAll(filepath.Join(wd, "foo", "bar", a, b), 0755)
if err != nil {
log.Fatal(err)
}
// remove the root of the long path
err = os.RemoveAll("foo")
if err != nil {
log.Fatal(err)
}
}