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

ForNAS - Changing the way we store files

Started by Forairan, 30 July 2012 - 12:39 PM
Forairan #1
Posted 30 July 2012 - 02:39 PM
What is ForNAS?
ForNAS is a NAS protocol in ComputerCraft. If anybody is familiar with the term "NAS", you'd know that it means "network attached storage".

There's already file transfer programs out there, so why are you making this?
I know there's plenty of ComputerCraft file transfer programs already, but I truly want to change the way we store files. Instead of uploading and downloading files from a central server, a central server runs ForNAS Server and can share its files with all connected computers, all while saving space on the Minecraft server by avoiding copying files to the client computers.
Take this scenario for example - I want to be able to access some important files that are frequently updated, and I have 5 computers. What should I do? I could use one computer as a file transfer server and set the other four up as file transfer clients, but that'd take time to manually update the clients! Instead, I install ForNAS Server on the central computer, and install the ForNAS Client on my four other computers. Now, whenever I update the files from any of my connected computers, I can access the updated files from any of my other connected computers - no syncing required!

So how does ForNAS work?
ForNAS works by hooking into functions in the FS and IO APIs, essentially tricking programs into believing that a NAS-shared folder is actually on the local computer. Each client has its own mount point, and the central server has a share point. If the ForNAS Client detects that a path passed to a FS/IO API function starts with the mount point, it will contact the NAS server over Rednet to perform the filesystem task and return the results. Otherwise, the native API call will be performed.
In layman's terms, if the NAS is mounted at "nas", the share directory on the server is "share", and you're attempting to open a file on "nas/test.txt", the ForNAS Client will make a call to the server to get the contents of "share/test.txt".

Sounds amazing! Where can I download it?
I'm not anywhere near release with ForNAS, so there's no download yet. Though I do have most functions in the FS API hooked to work with ForNAS, I still need to implement file handling, and being able to read/write files is (obviously) a big part of a NAS system. There's also plenty of bugs with how the system works right now that I need to fix before releasing anything.
limdingwen #2
Posted 30 July 2012 - 03:32 PM
So it is basically like iCloud, right? COOL!

Edit: By the way, I don't think you are supposed to post WIP programs here?
Edited on 30 July 2012 - 01:33 PM
Forairan #3
Posted 30 July 2012 - 06:21 PM
Yep, essentially like iCloud, Dropbox, or Google Drive, in the way that you can have multiple computers all connected to one file storage server.
I didn't see anything about not posting WIP programs here in the rules.
Lyqyd #4
Posted 30 July 2012 - 06:30 PM
If you're interested, there is a complete and working version of such a system already available. You may find that implementation instructive. I built and tested it weekend before last (IIRC; may have been the weekend before that), so it is still quite fresh in my mind. If you get stuck on anything, feel free to post in the Ask a Pro section or to PM me directly.

Also, the Program Library (or is it just Programs now?) has been the place to post complete programs. The section description mentioned that rule , I believe.
Forairan #5
Posted 30 July 2012 - 07:28 PM
If you're interested, there is a complete and working version of such a system already available. You may find that implementation instructive. I built and tested it weekend before last (IIRC; may have been the weekend before that), so it is still quite fresh in my mind. If you get stuck on anything, feel free to post in the Ask a Pro section or to PM me directly.

Also, the Program Library (or is it just Programs now?) has been the place to post complete programs. The section description mentioned that rule , I believe.

Ah, I see - your implementation uses user input supplied via an interactive program to download/upload files, etc.
That might be useful, thanks for letting me know of that. I'm mainly trying to make my implementation seamlessly integrate with CraftOS and the FS/IO APIs so users don't have to bother with uploading/downloading files.
Lyqyd #6
Posted 31 July 2012 - 01:16 AM
If you're interested, there is a complete and working version of such a system already available. You may find that implementation instructive. I built and tested it weekend before last (IIRC; may have been the weekend before that), so it is still quite fresh in my mind. If you get stuck on anything, feel free to post in the Ask a Pro section or to PM me directly.

Also, the Program Library (or is it just Programs now?) has been the place to post complete programs. The section description mentioned that rule , I believe.

Ah, I see - your implementation uses user input supplied via an interactive program to download/upload files, etc.
That might be useful, thanks for letting me know of that. I'm mainly trying to make my implementation seamlessly integrate with CraftOS and the FS/IO APIs so users don't have to bother with uploading/downloading files.

You found my 'filed' server (and are talking about the 'filec' client for it), but not the implementation of your idea that I was talking about. I was talking about my FS/IO API modification program that interacts with the 'filed' file server (on the file serving computer), but is invisible to the clients. You can find the FS/IO modification program on github. It uses remote/<label of server computer>/ which maps to files/folders in share/ on the remote computer.