From 556cee7f0971407eaf547e291d66041e16293b6b Mon Sep 17 00:00:00 2001 From: Mustafa M Date: Sun, 27 Dec 2020 04:45:40 -0500 Subject: [PATCH] win: Set correct folder permissions after folder creation (#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`. --- base/file.jl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/base/file.jl b/base/file.jl index d76e81f62364e..15150f44a2281 100644 --- a/base/file.jl +++ b/base/file.jl @@ -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)