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 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

This comment has been minimized.

Copy link
Member

@minux minux commented May 18, 2015

@Zillode

This comment has been minimized.

Copy link
Author

@Zillode 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

This comment has been minimized.

Copy link

@DmitriyMV DmitriyMV commented Feb 19, 2018

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

@bradfitz

This comment has been minimized.

Copy link
Contributor

@bradfitz bradfitz commented Feb 19, 2018

@DmitriyMV, thanks, closing. Fixed by 7a1347a

@bradfitz bradfitz closed this Feb 19, 2018
@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
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
6 participants
You can’t perform that action at this time.