287 posts
Location
Somewhere in the middle of nowhere.
Posted 08 August 2013 - 09: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().
1604 posts
Posted 08 August 2013 - 10: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.