mirror of
https://github.com/kepler155c/opus
synced 2025-01-15 18:05:42 +00:00
binary support fixes
This commit is contained in:
parent
4796e9e77a
commit
5c4ab57ec8
@ -669,6 +669,10 @@ if settings.get("motd.enabled") then
|
||||
end
|
||||
|
||||
while not bExit do
|
||||
local cx = term.getCursorPos()
|
||||
if cx ~= 1 then
|
||||
print()
|
||||
end
|
||||
if config.displayDirectory then
|
||||
term.setTextColour(_colors.directoryTextColor)
|
||||
term.setBackgroundColor(_colors.directoryBackgroundColor)
|
||||
|
@ -223,12 +223,12 @@ function fs.copy(s, t)
|
||||
end
|
||||
|
||||
else
|
||||
local sf = Util.readFile(s)
|
||||
local sf = Util.readFile(s, 'rb')
|
||||
if not sf then
|
||||
error('No such file')
|
||||
end
|
||||
|
||||
Util.writeFile(t, sf)
|
||||
Util.writeFile(t, sf, 'wb')
|
||||
end
|
||||
end
|
||||
|
||||
@ -378,4 +378,4 @@ function fs.restore()
|
||||
local native = fs.native
|
||||
Util.clear(fs)
|
||||
Util.merge(fs, native)
|
||||
end
|
||||
end
|
@ -43,4 +43,4 @@ end
|
||||
-- non-standard - will raise error instead
|
||||
os.exit = function(code)
|
||||
error(code or 0)
|
||||
end
|
||||
end
|
@ -72,4 +72,4 @@ function linkfs.move(node, s, t)
|
||||
return fs.move(s, t)
|
||||
end
|
||||
|
||||
return linkfs
|
||||
return linkfs
|
@ -154,6 +154,9 @@ function ramfs.open(node, fn, fl)
|
||||
|
||||
local ctr = 0
|
||||
return {
|
||||
readAll = function()
|
||||
return string.char(table.unpack(c))
|
||||
end,
|
||||
read = function(n)
|
||||
if n and n > 1 and ctr < node.size then
|
||||
-- some programs open in rb, when it should have
|
||||
|
@ -32,6 +32,7 @@ function UI.Tabs:add(children)
|
||||
if not self.tabBar then
|
||||
self.tabBar = UI.TabBar({
|
||||
buttons = buttons,
|
||||
backgroundColor = self.barBackgroundColor,
|
||||
})
|
||||
else
|
||||
self.tabBar:addButtons(buttons)
|
||||
|
@ -493,7 +493,7 @@ function Util.backup(fname)
|
||||
fs.copy(fname, backup)
|
||||
end
|
||||
|
||||
function Util.writeFile(fname, data)
|
||||
function Util.writeFile(fname, data, flags)
|
||||
if not fname or not data then error('Util.writeFile: invalid parameters', 2) end
|
||||
|
||||
if fs.exists(fname) then
|
||||
@ -505,7 +505,7 @@ function Util.writeFile(fname, data)
|
||||
end
|
||||
end
|
||||
|
||||
local file = io.open(fname, "w")
|
||||
local file = io.open(fname, flags or "w")
|
||||
if not file then
|
||||
error('Unable to open ' .. fname, 2)
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user