Jump to content




Overriding fs functionality



5 replies to this topic

#1 MrObsidy

  • Members
  • 63 posts
  • LocationHesse, Germany

Posted 22 May 2019 - 03:29 PM

I am currently working on a bootloadee that runs OSes in a Sandbox.

To do this I override every single function in fs to prefix the root directory.

This works like a charm for my applications (Empam) but as soon as I try to run OneOS the system crashes because of „Loop in gettable“

I did some reading and found out that it‘s appearantly caused by setfenv.


_G and setfenv is a big magic box to me, so how would I implement this properly?

#2 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 22 May 2019 - 04:39 PM

View PostMrObsidy, on 22 May 2019 - 03:29 PM, said:

To do this I override every single function in fs to prefix the root directory.

Just glancing through the fs API, this looks like it'll at least break fs.combine() and fs.complete().

It's very difficult to comment on your issue without seeing the relevant lines in OneOS in addition to your own code.

#3 SquidDev

    Frickin' laser beams | Resident Necromancer

  • Members
  • 1,427 posts
  • LocationDoes anyone put something serious here?

Posted 22 May 2019 - 04:41 PM

If your bootloader is just overwriting the fs library, I'd be surprised if this is an issue on your end - you'd need to start messing around with metatables for this to really be an issue. That said, without seeing your code, there's a limited amount we can really say.

Can you run OneOS without your bootloader? I've had issues getting it to run on recent versions of ComputerCraft, though can't remember the specifics.

#4 MrObsidy

  • Members
  • 63 posts
  • LocationHesse, Germany

Posted 22 May 2019 - 09:23 PM

@Bomb Bloke
Sorry, not every function. Fs.complete and fd.combine remain vailla.

@squiddev I‘m nor sure but I‘ll send you a github link.

#5 MrObsidy

  • Members
  • 63 posts
  • LocationHesse, Germany

Posted 23 May 2019 - 11:21 AM

Here you go:
https://github.com/MrObsidy/CC-PBL

The file of interest is /pbl/mounter

#6 MrObsidy

  • Members
  • 63 posts
  • LocationHesse, Germany

Posted 23 May 2019 - 12:39 PM

IMPORTANT EDIT:

Yeah, it was OneOS all along. My code worked...





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users