←  Ask a Pro

ComputerCraft | Programmable Computers for Minecraft

»

Global Programs / APIs

CRUGG's Photo CRUGG 31 May 2019

Hey there! Is it possible to globally install Programs and APIs from Code? I don't want to externally move the Code into the ROM Folder.
I know that you can set the program folder using
shell.setPath("/myPrograms/")
But this would not let me use the programs in /rom anymore and it would not let me be allowed to have seperate Folders for apis, programs etc.
I think the easiest way would be to just have a complete clone of the folder Structure of Rom somewhere and have both active, if that is possible.
Quote

Lupus590's Photo Lupus590 31 May 2019

Get the path first and then set the new path to be the old path and your new path.

The wiki for the setpath function might explain it better than me at the moment
Quote

EveryOS's Photo EveryOS 31 May 2019

shell.setPath(shell.path()..";myPrograms/;")
Quote

Luca_S's Photo Luca_S 02 Jun 2019

 EveryOS, on 31 May 2019 - 02:30 PM, said:

shell.setPath(shell.path()..";myPrograms/;")

According to the wiki the separator is ":", the path should be absolute and the trailing slash can be removed(I would suggest doing so to keep to the style of the existing path). Also the existing path does not end with a column, so neither should the new one:
shell.setPath(shell.path()..":/myPrograms")
Quote