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

Filesystems

Started by tenshae, 15 October 2014 - 07:00 PM
tenshae #1
Posted 15 October 2014 - 09:00 PM
This doesn't have to do with coding–well, kinda–but no one is clear about if such a question is against the rules. It is Computercraft related though!

I wanted to know how the computercraft mod implements it's virtual filesystem. (e.g.: the /rom mount)
This is something I've been investigating for quite a long time but no one seems to have an answer!
Thanks again.
KingofGamesYami #2
Posted 15 October 2014 - 11:41 PM
I think that's done java-side. However, the lua docs are available if you want to look through them: https://github.com/alekso56/ComputercraftLua.
tenshae #3
Posted 16 October 2014 - 12:48 AM
I think that's done java-side. However, the lua docs are available if you want to look through them: https://github.com/alekso56/ComputercraftLua.
Oh, I know it's done java-side. I was just wondering if someone had any knowledge of how, exactly, it accomplishes it.
natedogith1 #4
Posted 16 October 2014 - 02:28 AM
Computer Craft's file system is just your actual computer's file system. If your looking for the Java class that's used to access the real computer's file system, I believe you're looking for java.io.File
tenshae #5
Posted 16 October 2014 - 02:51 AM
Computer Craft's file system is just your actual computer's file system. If your looking for the Java class that's used to access the real computer's file system, I believe you're looking for java.io.File
You seem to misunderstand me. I know this, but I want to know how it handles things like the "/rom" mount, which is virtual.
KingofGamesYami #6
Posted 16 October 2014 - 03:03 AM
So, you want the actual java code they use to mount the /rom? In that case, I have no idea, I don't know Java. (yet)
ElvishJerricco #7
Posted 16 October 2014 - 03:09 AM
Take a look at the API for CC. There's an interface called IMount. An addon can create virtual mounts like /rom using IMount.