mirror of
https://github.com/kepler155c/opus
synced 2025-05-05 08:54:13 +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
|
end
|
||||||
|
|
||||||
while not bExit do
|
while not bExit do
|
||||||
|
local cx = term.getCursorPos()
|
||||||
|
if cx ~= 1 then
|
||||||
|
print()
|
||||||
|
end
|
||||||
if config.displayDirectory then
|
if config.displayDirectory then
|
||||||
term.setTextColour(_colors.directoryTextColor)
|
term.setTextColour(_colors.directoryTextColor)
|
||||||
term.setBackgroundColor(_colors.directoryBackgroundColor)
|
term.setBackgroundColor(_colors.directoryBackgroundColor)
|
||||||
|
@ -223,12 +223,12 @@ function fs.copy(s, t)
|
|||||||
end
|
end
|
||||||
|
|
||||||
else
|
else
|
||||||
local sf = Util.readFile(s)
|
local sf = Util.readFile(s, 'rb')
|
||||||
if not sf then
|
if not sf then
|
||||||
error('No such file')
|
error('No such file')
|
||||||
end
|
end
|
||||||
|
|
||||||
Util.writeFile(t, sf)
|
Util.writeFile(t, sf, 'wb')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -154,6 +154,9 @@ function ramfs.open(node, fn, fl)
|
|||||||
|
|
||||||
local ctr = 0
|
local ctr = 0
|
||||||
return {
|
return {
|
||||||
|
readAll = function()
|
||||||
|
return string.char(table.unpack(c))
|
||||||
|
end,
|
||||||
read = function(n)
|
read = function(n)
|
||||||
if n and n > 1 and ctr < node.size then
|
if n and n > 1 and ctr < node.size then
|
||||||
-- some programs open in rb, when it should have
|
-- some programs open in rb, when it should have
|
||||||
|
@ -32,6 +32,7 @@ function UI.Tabs:add(children)
|
|||||||
if not self.tabBar then
|
if not self.tabBar then
|
||||||
self.tabBar = UI.TabBar({
|
self.tabBar = UI.TabBar({
|
||||||
buttons = buttons,
|
buttons = buttons,
|
||||||
|
backgroundColor = self.barBackgroundColor,
|
||||||
})
|
})
|
||||||
else
|
else
|
||||||
self.tabBar:addButtons(buttons)
|
self.tabBar:addButtons(buttons)
|
||||||
|
@ -493,7 +493,7 @@ function Util.backup(fname)
|
|||||||
fs.copy(fname, backup)
|
fs.copy(fname, backup)
|
||||||
end
|
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 not fname or not data then error('Util.writeFile: invalid parameters', 2) end
|
||||||
|
|
||||||
if fs.exists(fname) then
|
if fs.exists(fname) then
|
||||||
@ -505,7 +505,7 @@ function Util.writeFile(fname, data)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local file = io.open(fname, "w")
|
local file = io.open(fname, flags or "w")
|
||||||
if not file then
|
if not file then
|
||||||
error('Unable to open ' .. fname, 2)
|
error('Unable to open ' .. fname, 2)
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user