var lvls:Array<String> = new Array<String>();
var fileNames:Array<String> = FileSystem.readDirectory(Reg.levelFileDir);
for (fileName in fileNames) {
lvls.push(fileName);
}
You should put a "try / catch" around the readDirecory in case the directory does not exits.
If you compile with -debug and start from xcode, you should get a more informative crash.
Hugh
FileSystem.createDirectory("asd123");
trace(FileSystem.exists("asd123") );
Hi
Your app can only create files/directories in certain areas. The "createDirectory" call is throwing an exception, which is what you are seeing. To avoid the hard crash, you should do:
try {
FileSystem.createDirectory("asd123");
}
catch(e:Dynamic) {
trace("Error : " + e );
}
But I think the solution to your problem is to start with one of the predefined directories, like:
nme.filesystem.File.applicationStorageDirectory
or
nme.filesystem.File.documentsDirectory
Hugh