[haXe] Checking/creating directory
Nicolas Cannasse
ncannasse at motion-twin.com
Tue Apr 10 22:17:43 CEST 2007
> I am fiddling around with a piece of code that checks for the existence
> of a directory, and if not present, creates it (in XP). The issue is
> when I create the folder:
>
> public function makeFolder(obj:Dynamic){
> //return neko.FileSystem.createDirectory(obj.folder);
> try {
> neko.FileSystem.createDirectory(obj.folder);
> } catch( msg : String ) {
> trace("Error message : " + msg );
> return false;
> }
> return true;
> }
>
> When I call the function, it creates the folder, but the console displays:
>
> App.hx:32: Error message : std at sys_file_type
That's a bit strange, are you sure that it's that trace that is
performed ? createDirectory implementation only uses the
"sys_create_dir" method, "sys_file_type" exception can occur when you
are using isDirectory(null) for instance.
Nicolas
More information about the Haxe
mailing list