os: implement MkdirAll

This commit is contained in:
Dan Kegel
2021-11-28 15:04:44 -08:00
committed by Ron Evans
parent 85ad157f3f
commit 8416bb61d8
5 changed files with 262 additions and 0 deletions
+11
View File
@@ -214,3 +214,14 @@ func fixLongPath(path string) string {
}
return string(pathbuf[:w])
}
// fixRootDirectory fixes a reference to a drive's root directory to
// have the required trailing slash.
func fixRootDirectory(p string) string {
if len(p) == len(`\\?\c:`) {
if IsPathSeparator(p[0]) && IsPathSeparator(p[1]) && p[2] == '?' && IsPathSeparator(p[3]) && p[5] == ':' {
return p + `\`
}
}
return p
}