Skip to content

Commit 756f3c9

Browse files
committed
Partially address JuliaLang#7385
This does not fully work on Windows (no support for ACLs), but is no worse than the current situation
1 parent a7e05df commit 756f3c9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

base/stat.jl

+2-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ for f in {
9696
:issetgid
9797
:issticky
9898
:isreadable
99-
:iswritable
10099
:isexecutable
101100
:uperm
102101
:gperm
@@ -107,6 +106,8 @@ end
107106

108107
islink(path...) = islink(lstat(path...))
109108

109+
@windows_only iswritable(path...) = ccall(:_waccess, Cint, (Ptr{Uint16}, Cint), utf16(joinpath(path...)), 2) == 0
110+
@unix_only iswritable(path...) = ccall(:access, Cint, (Ptr{Uint8}, Cint), joinpath(path...), 2) == 0
110111

111112
# some convenience functions
112113

0 commit comments

Comments
 (0)