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

SoftLink a program to all directories

Started by EveryOS, 04 December 2016 - 11:28 PM
EveryOS #1
Posted 05 December 2016 - 12:28 AM
I need to softLink a program to all working directories, so the user doesn't have to type

../../../../program argz
Kinda like edit, rm, help, programs, lua, cp, reboot, etc

Is this possible?
KingofGamesYami #2
Posted 05 December 2016 - 01:23 AM
How about we take a look at how it's done by computercraft. Looking at the lua files can be very informative.
Anavrins #3
Posted 05 December 2016 - 02:00 AM
The shell has the same concept of paths.

shell.setPath(shell.path()..":"..directory)
Adding "directory" to your path variable will make every executables in that folder runnable from everywhere.
However you have to run it everytime you boot up the computer, so it needs to be put in a startup file.
Lupus590 #4
Posted 05 December 2016 - 10:05 AM
if you want a single item instead of the directory you may want to use an alias instead: http://computercraft.info/wiki/Shell.setAlias
EveryOS #5
Posted 05 December 2016 - 11:52 AM
Thx