Makes sense, I'll give that a shot.
On Mar 28, 2015 08:12, "Timothy Brownawell" <
address@hidden> wrote:
On 03/23/2015 03:36 PM, Douglas Dickinson wrote:
Is there a monotone lua function like GET_ATTR(filename, attrname) ??
Sorry, we don't have that.
You might try taking the mtn:execute entry out of the attr_init_functions table (and clearing the attr on existing files), so you don't have both attrs populated on the same files. This wouldn't work if you're collaborating with people using the standard attr hooks, but it's probably the cleanest solution.
My own unix permissions handling attribute "ds:chmod" works,
BUT the execute bit is then overwritten by the "mtn:execute" handler,
So I want to override the default handler for "mtn:execute" to respect
both attributes,
Ideally something like:
attr_functions["mtn:execute"] =
function(filename, value)
if (GET_ATTR(filename, "ds:chmod") ~=nil) then -- ????
return execute(string.format("chmod %s %s", value, filename))
end
-- Continue like normal "mtn:execute"...
if (value == "true") then
set_executable(filename)
else
clear_executable(filename)
end
end
Many thanks in advance,
./ddd
-- Simple `chmod` handler
attr_functions["ds:chmod"] =
function(filename, value)
if value == nil then
return nil
end
return execute(string.format("chmod %s %s", value, filename))
end