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

[Lua] Run programs from different files

Started by pilot59, 04 June 2012 - 06:33 PM
pilot59 #1
Posted 04 June 2012 - 08:33 PM
I'm working on an OS and I want files for each user, I just need the computer to run programs from
Roaming/.techniclauncher/tekkit/saves/New World/computer/15/Jonathan
instead of from
Roaming/.techniclauncher/tekkit/saves/New World/computer/15
my_hat_stinks #2
Posted 04 June 2012 - 08:53 PM
Define "Run programs"

You mean from inside scripts?
From the shell?
Over a network?


Here's the files you want to override or modify:

mods\ComputerCraft\lua\rom\programs\cd
mods\ComputerCraft\lua\rom\programs\shell
mods\ComputerCraft\lua\rom\apis\fs
mods\ComputerCraft\lua\rom\apis\io (Possibly adding in overrides to io stuff here, you'll need to check that)
mods\ComputerCraft\lua\rom\apis\disk

and likely all the file modifying programs, too (edit, delete, rename, etc)
Every time the user tries to do anything to any file, you'll need to either redirect them or validate and restrict


Yeah, if you're really wanting to do this, work from the ground up instead :P
Xfel #3
Posted 04 June 2012 - 08:56 PM
did you try "cd Jonathan" and then type the run command? Or, to be more advanced, call shell.setPath(shell.path()..":/Jonathan") from the lua command prompt.
pilot59 #4
Posted 06 June 2012 - 01:47 AM
Here's how I have this setup, there's a login screen, once you login all programs you type in from the home screen are ran from a folder other than "15" also I'd like that to be automatic with creation of programs, but that's for a different thread. Also, I will need to run these using a varient of the shell.run("<program>")