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

[Lua]Finding the parent

Started by coolblockj, 18 March 2012 - 04:26 AM
coolblockj #1
Posted 18 March 2012 - 05:26 AM
I was wondering if there is a way to find the parent of the script, or somthing, because that might be handy to use.
natedogith1 #2
Posted 18 March 2012 - 08:48 AM
Do you mean find the parent folder?
coolblockj #3
Posted 18 March 2012 - 07:13 PM
Yeah
natedogith1 #4
Posted 18 March 2012 - 11:41 PM
shell.getRunningProgram() will get the program's path, then you can just know off everything after the last back-slash("") or add back-slash period period ("..") to the end