1
0
mirror of https://github.com/kepler155c/opus synced 2024-06-18 11:20:01 +00:00

1.12 fixes

This commit is contained in:
kepler155c@gmail.com 2018-03-30 17:01:56 -04:00
parent 3dd351cc86
commit 8db4fed19a
2 changed files with 9 additions and 5 deletions

View File

@ -1,13 +1,17 @@
--[[
Mount a readonly file system from another computer across rednet. The
target computer must be running OpusOS or redserver.
target computer must be running OpusOS or redserver. Dissimlar to samba
in that a snapshot of the target is taken upon mounting - making this
faster.
Useful for mounting a non-changing directory tree.
Syntax:
rn://<id>/directory/subdir
rttp://<id>/directory/subdir
Examples:
rn://12/usr/etc
rn://8/usr
rttp://12/usr/etc
rttp://8/usr
]]--
local rttp = require('rttp')

View File

@ -51,7 +51,7 @@ function urlfs.open(node, fn, fl)
local c = node.cache
if not c then
if node.url:match('^([%w][%w%+%-%.]*)%:') == 'rn' then
if node.url:match("^(rttps?:)") then
local s, response = rttp.get(node.url)
c = s and response.statusCode == 200 and response.data
else