How to get current path of a compiled AIR executable application and check a file and folder exist in same location?
I tried to use this code but it doesn't work:
var File1:File = File.applicationDirectory.resolvePath('APPAR-NC.exe');
if (File1.exists)
{
trace("The file exists.");
}
else
{
trace("The file does not exists.")
};
Just a small change in your code.
var File1:File = File.applicationDirectory.resolvePath("APPAR-NC.exe");
if (File1.exists)
{
if(File1.isDirectory)
trace("The folder exists.");
else
trace("The file exists.");
}
else
{
trace("The file does not exists.")
};