From 5d8a42b6667248e6c0fea881ffb9863d1374a68a Mon Sep 17 00:00:00 2001 From: Thijs Schreijer Date: Sun, 1 Dec 2013 09:06:50 +0100 Subject: simplified priviledge test on Windows --- src/luarocks/fs/win32.lua | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/luarocks/fs/win32.lua b/src/luarocks/fs/win32.lua index b6ea25e4..a3f0663b 100644 --- a/src/luarocks/fs/win32.lua +++ b/src/luarocks/fs/win32.lua @@ -201,11 +201,8 @@ function is_writable(file) if result then -- the above test might give a false positive when writing to -- c:\program files\ because of VirtualStore redirection on Vista and up - -- So get a directory listing and check whether it's really there - local pipe = io.popen("dir "..fs.Q(file)) - local dir_list = pipe:read("*a") - pipe:close() - result = (nil ~= string.find(dir_list, tmpname, 1, true)) + -- So check whether it's really there + result = fs.exists(file2) end os.remove(file2) else -- cgit v1.2.3-55-g6feb