This commit is contained in:
kepler155c@gmail.com 2019-03-12 20:04:28 -04:00
parent 86be65f026
commit e2508c9037
5 changed files with 20 additions and 0 deletions

View File

@ -414,6 +414,16 @@ end
function Util.writeFile(fname, data)
if not fname or not data then error('Util.writeFile: invalid parameters', 2) end
if fs.exists(fname) then
local diff = #data - fs.getSize(fname)
if diff > 0 then
if fs.getFreeSpace(fs.getDir(fname)) < diff then
error('Insufficient disk space for ' .. fname)
end
end
end
local file = io.open(fname, "w")
if not file then
error('Unable to open ' .. fname, 2)

View File

@ -13,6 +13,7 @@ if not _G.http.websocket then
end
if not _G.cloud_catcher then
print('Visit https://cloud-catcher.squiddev.cc')
print('Paste key: ')
local key = read()
if #key == 0 then

View File

@ -6,6 +6,7 @@ if not _G.http.websocket then
end
if not _G.cloud_catcher then
print('Visit https://cloud-catcher.squiddev.cc')
print('Paste key: ')
local key = read()
if #key == 0 then

View File

@ -113,6 +113,7 @@ local function splitpath(path)
end
local function getNode(dir)
if not dir then error('Invalid directory', 2) end
local cd = fs.combine(dir, '')
local parts = splitpath(cd)
local node = fs.nodes
@ -176,6 +177,8 @@ function fs.listEx(dir)
end
function fs.copy(s, t)
if not s then error('copy: bad argument #1') end
if not t then error('copy: bad argument #2') end
local sp = getNode(s)
local tp = getNode(t)
if sp == tp and sp.fs.copy then

5
sys/help/CloudCatcher Normal file
View File

@ -0,0 +1,5 @@
Cloud Catcher is a web terminal for ComputerCraft, allowing you to interact with any in-game computer in the browser, as well as edit files remotely!
To get started, visit https://cloud-catcher.squiddev.cc/cloud.lua for a session key.
Within Files, press 'c' to edit a file using Cloud Catcher.