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

programs not in root

Started by Microwarrior, 26 July 2015 - 03:58 PM
Microwarrior #1
Posted 26 July 2015 - 05:58 PM
I am making a program that needs to access many other files in order to function properly. I want this to be able to be placed in any directory on the system and have the main file access the other files relative to where it currently is. Ideally, I would want a command to return the main program's directory without using the search API or the local directiry. Keep in mind that the programs local directory may change many times throughout the program. Any help would be nice!
Edited on 26 July 2015 - 04:13 PM
flaghacker #2
Posted 26 July 2015 - 06:14 PM
You may be looking for shell.getRunningProgram(). You explenation isn't very clear though, how can the running directory change?
Microwarrior #3
Posted 26 July 2015 - 06:39 PM
Thanks for your help! this is what the solution was:
fs.getDir(shell.getRunningProgram())