Page 1 of 1

concatination with "\" and file existance check

Posted: October 8th, 2009, 2:10 am
by lalamax3d@gmail.com
basically my problems are

1- concatinate strings and adding "/" or "\" characters in it. for example

Code: Select all

path = "c:\batch\ins"
fileName = "quickTest.mov"
file = path + "\" + file; // this is giving error right now
2- check if file exist then load it as av layer in project, actually i know file is there but just wanna make sure, for example

Code: Select all

var chkFile = new File(fileName);
if (chkFile.exist){return true;} else {return false;}
i could imagine, because in this second prob, my filename = "/c/batch/ins/quickTest.mov"

btw: i m on cs3
any help / guidance will be really helpful
regards, lala

Re: concatination with "\" and file existance check

Posted: October 8th, 2009, 2:28 am
by lalamax3d@gmail.com
ok, first problem is solved via "\\", it is working fine

only problem left is, i m unable to make sure file exist, its always returning false in both cases

method1 = "/c/batch/ins/quickTest.mov";
method2 = "c:\batch\ins\quickTest.mov";
var chkFile1 = new File(method1);
var chkFile2 = new File(method2);

if (chkFile1.exist){return true;} else {return false;} // returns false, where as file does exist, come on
if (chkFile2.exist){return true;} else {return false;} // its also returning false,
please help
regards, lala

Re: concatination with "\" and file existance check

Posted: October 8th, 2009, 9:00 am
by lalamax3d@gmail.com
ok, issue has been resolved
a- "exists" spelling error
b- some xml file error "-" or "_" confusion.

thanks everyone