Skip to content
This repository was archived by the owner on Nov 6, 2022. It is now read-only.

Commit 375995c

Browse files
committed
r7: Fix the read-only-FS filemanager bug AmandaC found
This should fix everything
1 parent efae771 commit 375995c

File tree

3 files changed

+27
-26
lines changed

3 files changed

+27
-26
lines changed

claw/code-claw.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ return {
6767
},
6868
["neo-icecap"] = {
6969
desc = "KittenOS NEO / Icecap",
70-
v = 3,
70+
v = 7,
7171
deps = {
7272
"neo"
7373
},

code/docs/logo.bmp

0 Bytes
Binary file not shown.

code/libs/sys-filevfs.lua

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,15 @@ function getFsNode(fs, parent, fsc, path, mode)
9797
n[k + 1] = {nm, function () return nil, getFsNode(fs, t, fsc, fp, mode) end}
9898
end
9999
end
100+
if not dir then
101+
table.insert(n, {"Copy", function ()
102+
local rt, re = require("sys-filewrap").create(fsc, path, false)
103+
if not rt then
104+
return false, dialog("Open Error: " .. tostring(re), parent)
105+
end
106+
return nil, setupCopyVirtualEnvironment(fs, parent, rt, path:match("[^/]*$") or "")
107+
end})
108+
end
100109
if fscrw then
101110
if dir then
102111
table.insert(n, {"Mk. Directory", function ()
@@ -114,31 +123,6 @@ function getFsNode(fs, parent, fsc, path, mode)
114123
end
115124
}
116125
end})
117-
else
118-
if mode ~= nil then
119-
local tx = "Open"
120-
if mode == true then
121-
tx = "Save"
122-
elseif mode == "append" then
123-
tx = "Append"
124-
end
125-
if fscrw or mode == false then
126-
table.insert(n, {tx, function ()
127-
local rt, re = require("sys-filewrap").create(fsc, path, mode)
128-
if not rt then
129-
return false, dialog("Open Error: " .. tostring(re), parent)
130-
end
131-
return true, rt
132-
end})
133-
end
134-
end
135-
table.insert(n, {"Copy", function ()
136-
local rt, re = require("sys-filewrap").create(fsc, path, false)
137-
if not rt then
138-
return false, dialog("Open Error: " .. tostring(re), parent)
139-
end
140-
return nil, setupCopyVirtualEnvironment(fs, parent, rt, path:match("[^/]*$") or "")
141-
end})
142126
end
143127
if path ~= "/" then
144128
local delText = "Delete"
@@ -172,6 +156,23 @@ function getFsNode(fs, parent, fsc, path, mode)
172156
end})
173157
end
174158
end
159+
if (fscrw or mode == false) and mode ~= nil then
160+
local tx = "Open"
161+
if mode == true then
162+
tx = "Save"
163+
elseif mode == "append" then
164+
tx = "Append"
165+
end
166+
if fscrw or mode == false then
167+
table.insert(n, {tx, function ()
168+
local rt, re = require("sys-filewrap").create(fsc, path, mode)
169+
if not rt then
170+
return false, dialog("Open Error: " .. tostring(re), parent)
171+
end
172+
return true, rt
173+
end})
174+
end
175+
end
175176
return n
176177
end,
177178
unknownAvailable = dir and (mode ~= nil) and ((mode == false) or fscrw),

0 commit comments

Comments
 (0)