This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
PixelToast's profile picture

Seamless Virtual File System And Remote Sharing

Started by PixelToast, 20 October 2013 - 08:26 PM
PixelToast #1
Posted 20 October 2013 - 10:26 PM
[insert logo here]




instead of developing httpnet, i decided to make a new extremely useful api (and example program/pipe thing) that allows for wrapping folders as "pipes" that allow for you to do some cool stuff such as piping files into a table or even over the network, all seamlessly
i tried my best to emulate the fs api completely which includes errors and undefined behavior which makes it good as a learning tool to see how the fs api works
i can imagine many applications like having extremely fast fs access for something like tmp which is erased when the computer reboots or for encrypting the disk seamlessly



not too much documentation on this as it is pretty straight forward
i will start working on httpnet (reeeally close to finishing), not sure when i can start the server

please report bugs/suggestions ^-^

-snip lolo-
Lyqyd #2
Posted 20 October 2013 - 10:39 PM
note: this might take awhile to be approved (dont ask) so make sure to check github for the latest info

A whole 18 minutes. Sooo long. :P/>
amtra5 #3
Posted 21 October 2013 - 09:34 AM
-snip-
*Imagine :P/>

Edit: On topic, are you going to extend the functionality to something like immibis' vfs?
TheOddByte #4
Posted 21 October 2013 - 10:08 AM
Man I gotta say that this seems very nice( Even though I don't have a use for it :P/> )
Does this work for wireless btw?
PixelToast #5
Posted 21 October 2013 - 11:20 AM
Man I gotta say that this seems very nice( Even though I don't have a use for it :P/> )
Does this work for wireless btw?
yes but it isnt secure if you want it to be more secure you can use the soon to be new httpnet wrapping function

-snip-
*Imagine :P/>

Edit: On topic, are you going to extend the functionality to something like immibis' vfs?
oh wow wow i just saw that and it is the same exact thing xD
except he does not have proper errors and does not completely emulate it
http sounds like a cool idea though, ima add that and make the modem pipe actually save data
also i forgot i had used my own apis but diddnt include them
Dragon53535 #6
Posted 21 October 2013 - 02:23 PM
I look forward to amazing creations with this :D/>
MudkipTheEpic #7
Posted 21 October 2013 - 08:57 PM
From looking at the code, shouldn't you be making a copy of fs instead of assigning it a new name?

From my experience, if
type(y)=="table"
and then you assign x to y:
x=y
x is just a pointer/reference to y, not a copy.

If you were to redirect fs to a network, it would become a recursive loop.

Correct me if I'm wrong, or just misinterpreted your code.
PixelToast #8
Posted 22 October 2013 - 12:01 PM
tables dont point to other variables they point to the actual data
edit:
to clarify
y does not point to x
both point to a table
so if you modify y it does not effect how x points to the table
Lyqyd #9
Posted 22 October 2013 - 02:02 PM
Mudkip is right.


local a = {2, 4, 6}
local b = a
b[4] = 8
print(a[4])

That will print 8.
PixelToast #10
Posted 22 October 2013 - 02:14 PM
all the nope
not what he meant

local ofs=fs
fs={
derp=function()
ofs.derp()
end,
}
fs.derp
will not cause recursion
Lyqyd #11
Posted 22 October 2013 - 05:19 PM
What he said was correct, but if he missed you redefining it, then the concern about recursion is unfounded.
PixelToast #12
Posted 15 May 2014 - 10:06 PM
no im not dead.
added fs.getDir and removed eroutine
expect httpnet/tcpnet update
oeed #13
Posted 15 May 2014 - 11:13 PM
This is really nice, I can see it being used for remote logging in to computers but with an individual instance (i.e. in vnc). (similar to how Windows Server works)

Haven't looked a the code too much, but would it be possible to mount it at root? So something like this:


vfs.mount("/",dofile("fileshare")())
Edited on 15 May 2014 - 09:15 PM
PixelToast #14
Posted 16 May 2014 - 12:54 AM
probably yes, but might bork because of the lack of rom
Sir_Mr_Bman #15
Posted 16 May 2014 - 01:38 AM
The only thing that I dislike about your whole project:

The code on github isn't formatted to be Lua code, it's just plain text…



OCD FTW
PixelToast #16
Posted 16 May 2014 - 02:10 AM
its because CC doesnt have the .lua so github doesnt do its fancyness