From 375995c2d35394fc7a48fbe4caf66dd0377910fa Mon Sep 17 00:00:00 2001 From: 20kdc Date: Tue, 11 Dec 2018 16:09:54 +0000 Subject: [PATCH] r7: Fix the read-only-FS filemanager bug AmandaC found This should fix everything --- claw/code-claw.lua | 2 +- code/docs/logo.bmp | Bin 2598 -> 2598 bytes code/libs/sys-filevfs.lua | 51 +++++++++++++++++++------------------- 3 files changed, 27 insertions(+), 26 deletions(-) diff --git a/claw/code-claw.lua b/claw/code-claw.lua index dc3d133..ec2697b 100644 --- a/claw/code-claw.lua +++ b/claw/code-claw.lua @@ -67,7 +67,7 @@ return { }, ["neo-icecap"] = { desc = "KittenOS NEO / Icecap", - v = 3, + v = 7, deps = { "neo" }, diff --git a/code/docs/logo.bmp b/code/docs/logo.bmp index 11e3d46f76f380585014e22195a82dea344254a8..9fb2cdfbef0d29b1050d559fd21f64a41531b377 100644 GIT binary patch delta 57 zcmZ1`vP@*cQ8sP{1|XVvS`WkmGAI7mV+FAoCL1y8gT)xQC#N&&v2b%UaBrT;*vkO` DPvr`m delta 57 zcmZ1`vP@*cQ8or{1_o~KiKq2otp9qfV6n+YjQS8UhRNxSdMrRy44Y>%_HqCKQ|}6~ diff --git a/code/libs/sys-filevfs.lua b/code/libs/sys-filevfs.lua index 3534de0..c0c1f50 100644 --- a/code/libs/sys-filevfs.lua +++ b/code/libs/sys-filevfs.lua @@ -97,6 +97,15 @@ function getFsNode(fs, parent, fsc, path, mode) n[k + 1] = {nm, function () return nil, getFsNode(fs, t, fsc, fp, mode) end} end end + if not dir then + table.insert(n, {"Copy", function () + local rt, re = require("sys-filewrap").create(fsc, path, false) + if not rt then + return false, dialog("Open Error: " .. tostring(re), parent) + end + return nil, setupCopyVirtualEnvironment(fs, parent, rt, path:match("[^/]*$") or "") + end}) + end if fscrw then if dir then table.insert(n, {"Mk. Directory", function () @@ -114,31 +123,6 @@ function getFsNode(fs, parent, fsc, path, mode) end } end}) - else - if mode ~= nil then - local tx = "Open" - if mode == true then - tx = "Save" - elseif mode == "append" then - tx = "Append" - end - if fscrw or mode == false then - table.insert(n, {tx, function () - local rt, re = require("sys-filewrap").create(fsc, path, mode) - if not rt then - return false, dialog("Open Error: " .. tostring(re), parent) - end - return true, rt - end}) - end - end - table.insert(n, {"Copy", function () - local rt, re = require("sys-filewrap").create(fsc, path, false) - if not rt then - return false, dialog("Open Error: " .. tostring(re), parent) - end - return nil, setupCopyVirtualEnvironment(fs, parent, rt, path:match("[^/]*$") or "") - end}) end if path ~= "/" then local delText = "Delete" @@ -172,6 +156,23 @@ function getFsNode(fs, parent, fsc, path, mode) end}) end end + if (fscrw or mode == false) and mode ~= nil then + local tx = "Open" + if mode == true then + tx = "Save" + elseif mode == "append" then + tx = "Append" + end + if fscrw or mode == false then + table.insert(n, {tx, function () + local rt, re = require("sys-filewrap").create(fsc, path, mode) + if not rt then + return false, dialog("Open Error: " .. tostring(re), parent) + end + return true, rt + end}) + end + end return n end, unknownAvailable = dir and (mode ~= nil) and ((mode == false) or fscrw),