1
0
mirror of https://github.com/kepler155c/opus synced 2025-10-23 03:37:40 +00:00

lock computer

This commit is contained in:
kepler155c@gmail.com
2019-11-01 22:37:08 -06:00
parent aaab059cee
commit 5c35a8383e
3 changed files with 28 additions and 22 deletions

View File

@@ -1,3 +1,5 @@
local fs = _G.fs
if fs.native then
return
end
@@ -7,8 +9,6 @@ local Util = require('opus.util')
-- TODO: support getDrive for virtual nodes
local fs = _G.fs
fs.native = Util.shallowCopy(fs)
local fstypes = { }
@@ -16,7 +16,7 @@ local nativefs = { }
for k,fn in pairs(fs) do
if type(fn) == 'function' then
nativefs[k] = function(node, ...)
nativefs[k] = function(_, ...)
return fn(...)
end
end
@@ -340,8 +340,8 @@ function fs.unmount(path)
end
end
function fs.registerType(name, fs)
fstypes[name] = fs
function fs.registerType(name, vfs)
fstypes[name] = vfs
end
function fs.getTypes()

View File

@@ -11,7 +11,7 @@
-- 1 is reserved for compression exclusion
-- fs.addException('startup.lua', 1)
-- To renable compression for a file
-- To renable compression for a file
-- fs.removeException('startup.lua', 1)
-- Restores file system
@@ -23,6 +23,9 @@ local sub = string.sub
local tconcat = table.concat
local tinsert = table.insert
local bit = _G.bit
local fs = _G.fs
local SIGC = 'LZWC'
local IGNORE_COMPRESSION = 1 -- support other bits as well
@@ -157,7 +160,7 @@ local function decompress(input)
return tconcat(result)
end
function split(str, pattern)
local function split(str, pattern)
pattern = pattern or "(.-)\n"
local t = {}
local function helper(line) tinsert(t, line) return "" end
@@ -219,7 +222,7 @@ function fs.open(fname, flags)
end,
flush = function()
-- this isn't gonna work...
// f.write(compress(tconcat(c)))
-- f.write(compress(tconcat(c)))
f.flush();
end,
close = function()