Jump to content




Find current working directory

api

  • You cannot reply to this topic
2 replies to this topic

#1 cmdpwnd

  • Members
  • 128 posts
  • LocationHere

Posted 10 October 2015 - 11:15 PM

In a program how can I find the directory that the file being executed is in?

>ls test
file1.lua file2.lua
>test/file2.lua
Current Dir: test/
>
>

Edited by jacky500, 10 October 2015 - 11:15 PM.


#2 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 10 October 2015 - 11:18 PM

The best bet is shell.getRunningProgram(), then fs.getDir() on the value it returns.

#3 cmdpwnd

  • Members
  • 128 posts
  • LocationHere

Posted 10 October 2015 - 11:23 PM

great thnx :)





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users