- Fixed a container bug

- Added onDone to Program
This commit is contained in:
Robert Jelic
2025-06-20 14:19:05 +02:00
parent ea0f31fe37
commit 8067f23d42
16 changed files with 671 additions and 5 deletions

View File

@@ -0,0 +1,35 @@
local fileReader = {}
--- Read file content
--- @param filePath string Path to the file
--- @return string|nil content File content or nil if error
--- @return string|nil error Error message if any
function fileReader.readFile(filePath)
local file = io.open(filePath, "r")
if not file then
return nil, "Could not open file: " .. filePath
end
local content = file:read("*all")
file:close()
return content, nil
end
--- Write content to file
--- @param filePath string Path to the file
--- @param content string Content to write
--- @return string|nil error Error message if any
function fileReader.writeFile(filePath, content)
local file = io.open(filePath, "w")
if not file then
return "Could not open file for writing: " .. filePath
end
file:write(content)
file:close()
return nil
end
return fileReader