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

How to get directory of the file that's being run and asking for the directory.

Started by augustas656, 18 May 2014 - 03:57 PM
augustas656 #1
Posted 18 May 2014 - 05:57 PM
So like I have a startup in a disk, how do I get the directory, like disk or disk2 or disk3 which the startup is in?
fs.getDir()? but I don't know how I can use it for this. Is it possible? if so, how? Thanks

Regards,
Augustas
wieselkatze #2
Posted 18 May 2014 - 07:43 PM
For getting the running program you could just use

shell.getRunningProgram()
That should, for example, return "disk/startup".