Skip to content

Commit

Permalink
win: Set correct folder permissions after folder creation (JuliaLang#…
Browse files Browse the repository at this point in the history
…38942)

libuv's mkdir does not implement the mode argument on Windows, as a
result the folder mode is never passed on the Windows platform.

Forcibly change the folder permissions to agree with the mode passed
into `mkdir`.
  • Loading branch information
musm committed Dec 27, 2020
1 parent d04793f commit 556cee7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions base/file.jl
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,8 @@ function mkdir(path::AbstractString; mode::Integer = 0o777)
uv_error("mkdir($(repr(path)); mode=0o$(string(mode,base=8)))", ret)
end
ccall(:uv_fs_req_cleanup, Cvoid, (Ptr{Cvoid},), req)
# mode is not implemented in mkdir in libuv yet, so do it here
Sys.iswindows() && chmod(path, mode)
return path
finally
Libc.free(req)
Expand Down

0 comments on commit 556cee7

Please sign in to comment.