Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
package main
import "fmt"
import "os"
func main() {
path := `F:\BOOM`
dir, err := os.Stat(path)
if err == nil {
if dir.IsDir() {
fmt.Printf("Found folder %s. Lets see what happens now.\n", path)
}
}
path = `\\?\F:\BOOM\BANG`
// this will fail
err = os.MkdirAll(path, 448)
if err != nil {
fmt.Printf("1 failed: MkdirAll( %v , perm ) err = %v\n", path, err)
}
path = `\\?\F:\BOOM`
// this will fail also
err = os.MkdirAll(path, 448)
if err != nil {
fmt.Printf("2 failed: MkdirAll( %v , perm ) err = %v\n", path, err)
}
path = `F:\BOOM\BANG`
// this will succeed, no UNC prefix
err = os.MkdirAll(path, 448)
if err != nil {
fmt.Printf("3 failed: MkdirAll( %v , perm ) err = %v\n", path, err)
} else {
fmt.Printf("done: MkdirAll( %v , perm ) err = %v\n", path, err)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.