1
mirror of https://github.com/rclone/rclone synced 2024-12-10 22:33:56 +01:00
rclone/lib/file/mkdir_other.go
albertony fbc7f2e61b lib/file: improve error message when attempting to create dir on nonexistent drive on windows
This replaces built-in os.MkdirAll with a patched version that stops the recursion
when reaching the volume part of the path. The original version would continue recursion,
and for extended length paths end up with \\? as the top-level directory, and the error
message would then be something like:
mkdir \\?: The filename, directory name, or volume label syntax is incorrect.
2021-10-01 23:18:39 +02:00

12 lines
205 B
Go

//go:build !windows
// +build !windows
package file
import "os"
// MkdirAll just calls os.MkdirAll on non-Windows.
func MkdirAll(path string, perm os.FileMode) error {
return os.MkdirAll(path, perm)
}