diff --git a/base/file.jl b/base/file.jl index eb0217a819195c..9e91f433f2942d 100644 --- a/base/file.jl +++ b/base/file.jl @@ -261,7 +261,7 @@ function rm(path::AbstractString; force::Bool=false, recursive::Bool=false) try @static if Sys.iswindows() # is writable on windows actually means "is deletable" - if (filemode(path) & 0o222) == 0 + if (filemode(lstat(path)) & 0o222) == 0 chmod(path, 0o777) end end