1583 posts
Location
Germany
Posted 09 May 2013 - 08:42 PM
Question in the title …
5 posts
Posted 09 May 2013 - 09:09 PM
It resolves a relative path into an absolute path.
When you launch a program, your program's current working directory is wherever you were when you launched it. Also, you can change the working directory using
shell.setDir("mySubDir")
So, if you have a subdirectory called mySubDir, and in that directory you have a file called a.txt, and if your working directory was in the mySubDir, and you ran the following statements:
> cd mySubDir
mySubDir> lua
lua> shell.resolve("a.txt")
You would get back:
mySubDir/a.txt
Pretty much only useful for either really complicated programs, or programs that are loaded into the programs directory, and thus can be run from any directory (programs like 'edit')
1583 posts
Location
Germany
Posted 10 May 2013 - 04:27 AM
Thank you so much guy!
2217 posts
Location
3232235883
Posted 10 May 2013 - 10:42 AM
unlike fs.combine("",dir) it will also resolve program paths
> shell.resolve("ls")
rom/programs/ls
it ignores the current directory if you put a slash infront of it
it will also resolve backward indexes (../)