Today I’ve learned that the only way, tested so far, to get parent paths from the applicationDirectory is using the File object constructor:
var _parentDir:File = new File( File.applicationDirectory.nativePath + "/../" )
It looks that something like this with any combinations of strings:
var _parentDir:File = File.applicationDirectory.resolvePath("../")
definitely doesn’t work.
What about File.applicationDirectory.parent?
I think it should be OK…
Hi Quentin,
This was the first thing I did, I forgot to mention it on this post.
Since applicationDirectory and applicationStorageDirectory as well do not use the complete url scheme but the shortcut one like app:/ and app-storage:/, any use of parent property or url / nativePath manipulations will return null because app and app-storage are root directory.
Ah, I get it now!
Thanks for answering in detail, that was looking odd to me…
Thank you! I was hunting around for ages trying to find a way to get a relative path from the app directory to a file and
_parentDir:File = new File( File.applicationDirectory.nativePath)
worked like a charm