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

Finding where file is being run from?

Started by digpoe, 13 May 2013 - 08:10 AM
digpoe #1
Posted 13 May 2013 - 10:10 AM
I'm working in Lua (not ComputerCraft Lua or another variant) and I want to know how you can find where the current Lua script is being stored

I mean, something like this:

C:\Users\blergh\example.Lua

I want to be able to find that in the Lua script in example.Lua and be able to say; "That's where I'm running from."

I'm looking in the IO library and the 'LuaFileSystem' module, but I've not found anything that returns the directory of the currently executing script.
theoriginalbit #2
Posted 13 May 2013 - 10:28 AM
Here is a StackOverflow article I found on the matter… http://stackoverflow.com/questions/6032268/get-current-working-directory-in-lua
digpoe #3
Posted 13 May 2013 - 01:50 PM
Here is a StackOverflow article I found on the matter… http://stackoverflow...irectory-in-lua

Thanks man.