summaryrefslogtreecommitdiffstats
path: root/app/logfiles/logfiles-model.lua
blob: 61981075c91b5c49946dcb816ec0a97c3d62f620 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
module (..., package.seeall)

-- no initializer in model - use controller.init for that

local function read_file ( path )
	local file = io.open(path)
	if ( file ) then
		local f = file:read("*a") or "unknown"
		file:close()
		return f
	else
		return "Cant find '" .. path .. "'"
	end
end

get = function (self,path)
	local file_content = {}
	file_content = cfe{value=read_file(path), name=path}
	file_name = cfe{value=path, name=file_name}
	return file_content, file_name
end