AnthonyD98, on 07 February 2013 - 08:32 PM, said:
Sorry, I didn't really undertstand your edit.
Then you should have asked me there instead of posting a new topic...
Lets try this again:
There is no way to get the currently running programs file path. We have to write it ourself. Like this
function getPath()
local runningProgram = shell.getRunningProgram()
local programName = fs.getName( runningProgram )
return runningProgram:sub( 1, #runningProgram - #programName )
end
fs.makeDir( getPath().."/sel" )
shell.getRunningProgram returns the absolute path of the running program, including the programs name
fs.getName gets that name
then we use
string.sub to get the path from the absolute. to do this we tell it to go from the start of the absolute to the end of the absolute minus the name
does this explanation make more sense?