From a487dcf44cc7cd8da9d1e05bbf8a32a04a109574 Mon Sep 17 00:00:00 2001 From: Isaiah Norton Date: Thu, 26 Jun 2014 00:24:19 -0400 Subject: [PATCH] Partially address #7385 This does not fully work on Windows, but is no worse than the current situation --- base/stat.jl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/base/stat.jl b/base/stat.jl index b76e7f28152e9..6e514ca7b82f7 100644 --- a/base/stat.jl +++ b/base/stat.jl @@ -96,7 +96,6 @@ for f in { :issetgid :issticky :isreadable - :iswritable :isexecutable :uperm :gperm @@ -107,6 +106,8 @@ end islink(path...) = islink(lstat(path...)) +@windows_only iswritable(path...) = ccall(:_waccess, Cint, (Ptr{Uint16}, Cint), utf16(joinpath(path...)), 2) == 0 +@unix_only iswritable(path...) = ccall(:access, Cint, (Ptr{Uint8}, Cint), joinpath(path...), 2) == 0 # some convenience functions