From f77e093ae46db3afc856a90d82e8c8b8b8b98246 Mon Sep 17 00:00:00 2001 From: Taco Hoekwater Date: Sat, 4 Jun 2011 10:29:11 +0000 Subject: better version of file.is_writable() from Hans git-svn-id: svn://tug.org/texlive/trunk@22770 c570f23f-e606-0410-a88d-b1316a301751 --- Master/bin/i386-freebsd/mtxrun | 36 ++++++++++++++---------------------- 1 file changed, 14 insertions(+), 22 deletions(-) (limited to 'Master/bin/i386-freebsd/mtxrun') diff --git a/Master/bin/i386-freebsd/mtxrun b/Master/bin/i386-freebsd/mtxrun index 94867f6eb34..29f2eadb437 100755 --- a/Master/bin/i386-freebsd/mtxrun +++ b/Master/bin/i386-freebsd/mtxrun @@ -2524,26 +2524,20 @@ end function file.is_writable(name) - if os.type == "windows" then - local a = attributes(name) or attributes(dirname(name,".")) - return a and sub(a.permissions,2,2) == "w" - end - local f - local isnew = true if lfs.isdir(name) then - name = name .. "/mtxtest.txt" + name = name .. "/m_t_x_t_e_s_t.tmp" + local f = io.open(name,"wb") + if f then + f:close() + os.remove(name) + return true + end else - f = io.open(name, "rb"); - if f then - f:close() - isnew = false - end - end - f = io.open(name, "wb"); - if f then - f:close() - if isnew then os.remove(name) end - return true + f = io.open(name,"ab") + if f then + f:close() + return true + end end return false end @@ -11153,11 +11147,9 @@ resolvers.luacnfname = 'texmfcnf.lua' resolvers.luacnfstate = "unknown" -- resolvers.luacnfspec = '{$SELFAUTODIR,$SELFAUTOPARENT}{,{/share,}/texmf{-local,}/web2c}' -- what a rubish path +resolvers.luacnfspec = 'selfautoparent:{/texmf{-local,}{,/web2c},}}' + --- changed by Taco Hoekwater to make /texmfnf.lua take precedence, --- while still allowing /texmf/texmfnf.lua and --- /texmf/web2c/texmfnf.lua (in that order) -resolvers.luacnfspec = '{selfautodir:,selfautoparent:};{selfautodir:,selfautoparent:}{/share,}/texmf{-local,};{selfautodir:,selfautoparent:}{/share,}/texmf{-local,}/web2c' local unset_variable = "unset" -- cgit v1.2.3