Using Lua, check if file is a directory
snippet in lua

Using Lua, check if file is a directory

user4154

function is_dir(path)
    local f = io.open(path, "r")
    local ok, err, code = f:read(1)
    f:close()
    return code == 21
end