Jump to content




Fs.getdirectory()


  • This topic is locked This topic is locked
1 reply to this topic

#1 Antelux

  • Members
  • 295 posts
  • LocationSomewhere in the middle of nowhere.

Posted 08 August 2013 - 08:11 PM

I'm not sure if this function exists or if there is a way to do it. If there is just lock this post but if there isnt it would be cool if you could get the name of the file path you're currently in using a function like fs.getDirectory().

#2 MysticT

    Lua Wizard

  • Members
  • 1,597 posts

Posted 08 August 2013 - 09:07 PM

The current directory is managed by the shell, so you have to use the shell api to get it. Use shell.dir() to get the current directory and shell.setDir(path) to change it.
Note that changing the current directory doesn't affect the fs api, since it uses absolute paths. To get the absolute path to a file in the current directory you can use shell.resolve(filename).
More on the shell api on the wiki.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users