Skip to content
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

os: MkdirAll fails when creating top-level UNC paths on Windows #10900

Closed
Zillode opened this issue May 18, 2015 · 4 comments
Closed

os: MkdirAll fails when creating top-level UNC paths on Windows #10900

Zillode opened this issue May 18, 2015 · 4 comments

Comments

@Zillode
Copy link

Zillode commented May 18, 2015

Go 1.4, Windows

When the top-level folder of a Windows UNC path does not exist, the os.MkdirAll function goes one step too deep in recursion. This is illustrated in the following scenario:

  1. Make sure C:\Test does not exist
  2. Try to create a new folder with arbitrary depth os.MkdirAll("\\\\?\\C:\\Test", 0700) using UNC (we use UNC to support long paths).
  3. This fails with The filename, directory name, or volume label syntax is incorrect. This is due to a bug in the Go library. The callstack reveals that it tries to create the folder \\?, which should not happen.

(Related to syncthing/syncthing#1822)

@minux
Copy link
Member

minux commented May 18, 2015 via email

@Zillode
Copy link
Author

Zillode commented May 18, 2015

I figured this issue is different because we use explicitly use the UNC paths (where #3358 tries to automatically support long paths for all functions).
We'll implement a custom MkdirAll if this seems out of scope for the moment, thanks.

@DmitriyMV
Copy link

@minux @ianlancetaylor I think it's a predecessor of #22230 and can be safely closed.

@bradfitz
Copy link
Contributor

@DmitriyMV, thanks, closing. Fixed by 7a1347a

@golang golang locked and limited conversation to collaborators Feb 19, 2019
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

6 participants