Skip to content

Commit 455f113

Browse files
musmstaticfloat
authored andcommitted
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`. (cherry picked from commit 556cee7)
1 parent 42cefc9 commit 455f113

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

base/file.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,8 @@ function mkdir(path::AbstractString; mode::Integer = 0o777)
179179
uv_error("mkdir($(repr(path)); mode=0o$(string(mode,base=8)))", ret)
180180
end
181181
ccall(:uv_fs_req_cleanup, Cvoid, (Ptr{Cvoid},), req)
182+
# mode is not implemented in mkdir in libuv yet, so do it here
183+
Sys.iswindows() && chmod(path, mode)
182184
return path
183185
finally
184186
Libc.free(req)

0 commit comments

Comments
 (0)