diff options
author | Thijs Schreijer <thijs@thijsschreijer.nl> | 2013-12-01 09:06:50 +0100 |
---|---|---|
committer | Thijs Schreijer <thijs@thijsschreijer.nl> | 2013-12-01 09:06:50 +0100 |
commit | 5d8a42b6667248e6c0fea881ffb9863d1374a68a (patch) | |
tree | 212b7968ecd871c7378fea009af7e66a1e3a83c5 | |
parent | 3cd6318db05dce7c18c191061cbb29c0d9aed5cd (diff) | |
download | luarocks-5d8a42b6667248e6c0fea881ffb9863d1374a68a.tar.gz luarocks-5d8a42b6667248e6c0fea881ffb9863d1374a68a.tar.bz2 luarocks-5d8a42b6667248e6c0fea881ffb9863d1374a68a.zip |
simplified priviledge test on Windows
-rw-r--r-- | src/luarocks/fs/win32.lua | 7 |
1 files changed, 2 insertions, 5 deletions
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) | |||
201 | if result then | 201 | if result then |
202 | -- the above test might give a false positive when writing to | 202 | -- the above test might give a false positive when writing to |
203 | -- c:\program files\ because of VirtualStore redirection on Vista and up | 203 | -- c:\program files\ because of VirtualStore redirection on Vista and up |
204 | -- So get a directory listing and check whether it's really there | 204 | -- So check whether it's really there |
205 | local pipe = io.popen("dir "..fs.Q(file)) | 205 | result = fs.exists(file2) |
206 | local dir_list = pipe:read("*a") | ||
207 | pipe:close() | ||
208 | result = (nil ~= string.find(dir_list, tmpname, 1, true)) | ||
209 | end | 206 | end |
210 | os.remove(file2) | 207 | os.remove(file2) |
211 | else | 208 | else |