Code: [Select]
function fileExists(path)
{
try
{
local myfile = file(path, "r");
}
catch(myfile)
{
return 0;
}
return 1;
}
if file exist is no problem... but if isn't it have errors Code: [Select]
<03/12/2011 - 14:32:34>
AN ERROR HAS OCCURED [cannot open file]
<03/12/2011 - 14:32:34>
CALLSTACK
<03/12/2011 - 14:32:34> *FUNCTION [fileExists()] Scripts/Main/lc_fd.nut line [90]
<03/12/2011 - 14:32:34> *FUNCTION [onScriptLoad()] Scripts/Main/lc_fd.nut line [45]
<03/12/2011 - 14:32:35>
LOCALS
<03/12/2011 - 14:32:35> [path] "/LU/data/test.txt"
<03/12/2011 - 14:32:35> [this] TABLE
<03/12/2011 - 14:32:35> [this] TABLE
<03/12/2011 - 14:32:35>
AN ERROR HAS OCCURED [cannot open file]
<03/12/2011 - 14:32:35>
CALLSTACK
<03/12/2011 - 14:32:35> *FUNCTION [fileExists()] Scripts/Main/lc_fd.nut line [90]
<03/12/2011 - 14:32:35> *FUNCTION [onScriptLoad()] Scripts/Main/lc_fd.nut line [49]
<03/12/2011 - 14:32:35>
LOCALS
<03/12/2011 - 14:32:35> [path] "/LU/data/test.txt"
<03/12/2011 - 14:32:35> [this] TABLE
<03/12/2011 - 14:32:35> [this] TABLE