Jump to content




FSector

api

17 replies to this topic

#1 Sewbacca

  • Members
  • 450 posts
  • LocationStar Wars

Posted 05 October 2016 - 06:25 PM

[BETA] FSector (ysq0bCcH)

What is FSector?
Short description:
FSector creates separated fs, like window.create for the terminal.

Why should I use FSector?
Here are some examples:
  • Sandbox programs
  • Virtual machines (mount rom into a directory and create the handle)
  • Virtual hard disk drives
  • Set ReadOnly (e. g. an OS folder or password files (to prevent setting a password to '' for example))
  • Save storage with mounting paths into directories
  • handle.mount simulates hard links
  • Hierarchy your file systems (e. g. native fs -> Drives/{0} or native fs -> rom/help (i mean the help files))
  • Mount disks into other directorys (for example in Drives/{0}/disk)
  • Sharing data between programs (by using handle.mount())
  • Executing programs relative to their destinations.
  • Things i forgot.
Are there other things, I should now?

Documentation
Spoiler

Example
Spoiler

Screenshots
Spoiler

WIP [Work in progress]
Spoiler

License
Spoiler










Thanks all people, who helped me choosing a name =)


Please report any bugs and

feel free to post suggestions and constructive criticism to this API.


Enjoy it

Sewbacca


Edited by Sewbacca, 12 October 2016 - 03:39 PM.


#2 Creator

    Mad Dash Victor

  • Members
  • 2,168 posts
  • LocationYou will never find me, muhahahahahaha

Posted 05 October 2016 - 07:18 PM

This is great! I don't say this often, but there some programs that simply amaze me. This is one of them.

#3 Sewbacca

  • Members
  • 450 posts
  • LocationStar Wars

Posted 05 October 2016 - 07:39 PM

View PostCreator, on 05 October 2016 - 07:18 PM, said:

This is great! I don't say this often, but there some programs that simply amaze me. This is one of them.
Thank you very much =)

#4 TheRockettek

  • Members
  • 547 posts
  • LocationRem is best girl

Posted 05 October 2016 - 08:13 PM

This program gave me an idea to make like VMWare for computercraft :D and instead of it just sandboxing shell and stuff, you can emulate all the files on a computer (bios and rom) in a computer :D

tldr vmware in cc

#5 Sewbacca

  • Members
  • 450 posts
  • LocationStar Wars

Posted 06 October 2016 - 11:33 AM

View PostTheRockettek, on 05 October 2016 - 08:13 PM, said:

This program gave me an idea to make like VMWare for computercraft :D and instead of it just sandboxing shell and stuff, you can emulate all the files on a computer (bios and rom) in a computer :D

tldr vmware in cc
I got the idea of creating fs handles, by developing a VMWare Player. Also SOSP (An Operating System Package manager) will use this API to emulates hard drives with different OS. It (will) contains BIOS, kernel and a boot loader.

#6 thecrimulo

  • Members
  • 87 posts
  • Locationhere

Posted 06 October 2016 - 02:00 PM

This is amazing. Full control over filesystem and adding new functions, tho I'd like documentation for all the functions!
Keep up the good work

~Dael

#7 Sewbacca

  • Members
  • 450 posts
  • LocationStar Wars

Posted 06 October 2016 - 05:47 PM

View Postthecrimulo, on 06 October 2016 - 02:00 PM, said:

This is amazing. Full control over filesystem and adding new functions, tho I'd like documentation for all the functions!
Keep up the good work

~Dael

Shortly i added one, thank you =)
Sewbacca

#8 Sewbacca

  • Members
  • 450 posts
  • LocationStar Wars

Posted 06 October 2016 - 09:06 PM

Oh, i found a bug in my screenshots, i add it to WIP.

#9 TheRockettek

  • Members
  • 547 posts
  • LocationRem is best girl

Posted 07 October 2016 - 07:45 PM

would be cool if the errors werent like what it shows in the screenshots d: you could just use printError and a return :D

#10 Sewbacca

  • Members
  • 450 posts
  • LocationStar Wars

Posted 09 October 2016 - 11:53 AM

View PostTheRockettek, on 07 October 2016 - 07:45 PM, said:

would be cool if the errors werent like what it shows in the screenshots d: you could just use printError and a return :D

Thank you, but i am currently working on resolving mounted paths, what sadly doesn't work right andIthe error messages are a minor problem.

I added fs.current() etc. but i need some help to find the problem with resolving mounted paths.
Can sb. help me please, with debugging my code?

Edited by Sewbacca, 09 October 2016 - 12:07 PM.


#11 Sewbacca

  • Members
  • 450 posts
  • LocationStar Wars

Posted 10 October 2016 - 01:04 PM

Had anyone found the problem?

#12 Creator

    Mad Dash Victor

  • Members
  • 2,168 posts
  • LocationYou will never find me, muhahahahahaha

Posted 10 October 2016 - 03:10 PM

It truly is a pain. Maybe take a look at this code, since it should do the same thing. I haven't looked at your code yet since I'm short on time, but I will at some point.

#13 Sewbacca

  • Members
  • 450 posts
  • LocationStar Wars

Posted 10 October 2016 - 03:35 PM

Here my question in Ask a pro.

Edited by Sewbacca, 10 October 2016 - 03:35 PM.


#14 Sewbacca

  • Members
  • 450 posts
  • LocationStar Wars

Posted 12 October 2016 - 12:25 PM

View PostSewbacca, on 10 October 2016 - 03:35 PM, said:

Here my question in Ask a pro.

I found the problem. The redirection of a fs and the example of my question works now and i updated the code =)
Sewbacca =)

Edited by Sewbacca, 12 October 2016 - 12:30 PM.


#15 HaddockDev

  • Members
  • 61 posts
  • LocationSomewhere, deep down under a rainbow.

Posted 14 October 2016 - 10:54 AM

This seems really neat, it's been a while since I've seen something like this so its the kind of thing that goes in my bookmarks.
I will try this once some bugs are ironed out and I'd probably include this into something of mine because of what this is, it really could help
with the temporary folders and/or sandboxing.

tldr its good

#16 Sewbacca

  • Members
  • 450 posts
  • LocationStar Wars

Posted 16 October 2016 - 03:58 PM

View PostHaddock, on 14 October 2016 - 10:54 AM, said:

This seems really neat, it's been a while since I've seen something like this so its the kind of thing that goes in my bookmarks.
I will try this once some bugs are ironed out and I'd probably include this into something of mine because of what this is, it really could help
with the temporary folders and/or sandboxing.

tldr its good

Thank you
Spoiler

Sewbacca

#17 HaddockDev

  • Members
  • 61 posts
  • LocationSomewhere, deep down under a rainbow.

Posted 26 November 2016 - 05:14 PM

Well, I have tried it out with sandboxing, and it works pretty well.
You do need to work on things trying not to get out, especially if somebody's going to be developing a VMWare or something for this.
When emulating a computer (copying /rom into a folder, removing all the apis and such) the shell is breaking out of the sandbox,
allowing direct access to the real /, instead of the one where it is just /rom.
That's my only complaint.
Good job though.
This is the code I'm using, poorly written too

Edited by Haddock, 26 November 2016 - 05:20 PM.


#18 Sewbacca

  • Members
  • 450 posts
  • LocationStar Wars

Posted 26 November 2016 - 06:15 PM

View PostHaddock, on 26 November 2016 - 05:14 PM, said:

--snip

First, thanks trying out my API =)
But you did a mistake:
handle.mount(source, destination)
not destination, source
And the fs you setted has only access to /sandbox.
So you have to create a parent with access to the root directory, mount the directory and then create a child:
local toplevel = FSector.create(fs.current(), '')
local sandbox_fs = FSector.create(toplevel, 'sandbox')
toplevel.mount('rom', 'sandbox/rom') -- Now sandbox_fs sees rom in his root directory
This code should work.
Thank you testing my API =)

Edited by Sewbacca, 26 November 2016 - 07:05 PM.






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users