Skip to content

golang not supporting windows paths over 255 characters #14495

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
aemengo opened this issue Feb 24, 2016 · 1 comment
Closed

golang not supporting windows paths over 255 characters #14495

aemengo opened this issue Feb 24, 2016 · 1 comment

Comments

@aemengo
Copy link

aemengo commented Feb 24, 2016

For instance, when I make a path on a windows system, it usually fails with a way too long error:

package main

import "os"

func main() {
    err := os.MkdirAll(`C:\Users\AAAA\BBBB\CCCC\DDDD\EEEE\FFFF\GGGG\HHHH\IIII\JJJJ\KKKK\LLLL\MMMM\NNNN\OOOO\PPPP\QQQQ\RRRR\SSSS\TTTT\UUUU\VVVV\WWWW\XXXX\YYYY\ZZZZ\AAAA\BBBB\CCCC\DDDD\EEEE\FFFF\GGGG\HHHH\IIII\JJJJ\KKKK\LLLL\MMMM\NNNN\OOOO\PPPP\QQQQ\RRRR\SSSS\TTTT\UUUU\VVVV\WWWW\XXXX\YYYY\ZZZZ`, os.ModePerm)
    if err != nil {
        panic(err)
    }
}
......
// result

mkdir C:\Users\AAAA\BBBB\CCCC\DDDD\EEEE\FFFF\GGGG\HHHH\IIII\JJJJ\KKKK\LLLL\MMMM\NNNN\OOOO\PPPP\QQQQ\RRRR\SSSS\TTTT\UUUU\VVVV\WWWW\XXXX\YYYY\
ZZZZ\AAAA\BBBB\CCCC\DDDD\EEEE\FFFF\GGGG\HHHH\IIII\JJJJ\KKKK\LLLL\MMMM\NNNN\OOOO\PPPP\QQQQ\RRRR\SSSS\TTTT\UUUU\VVVV: The filename or extensio
n is too long.

To be clear, this is usually fixed by prepending \\?\ to the path.

What version of Go are you using (go version)? go1.5.3
What operating system and processor architecture are you using? windows/amd64 - Windows2012R2
What did you do? Create a very very long path, as per example
What did you expect to see? No error creating the directory
What did you see instead? os.PathError creating the directory

@rakyll
Copy link
Contributor

rakyll commented Feb 24, 2016

Duplicate of #3358.

@rakyll rakyll closed this as completed Feb 24, 2016
@golang golang locked and limited conversation to collaborators Feb 28, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants