concatination with "\" and file existance check

Find out why the . goes before the /

Moderator: Paul Tuersley

Post Reply
lalamax3d@gmail.com
Posts: 5
Joined: June 10th, 2008, 8:13 am

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
lalamax3d@gmail.com
Posts: 5
Joined: June 10th, 2008, 8:13 am

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
lalamax3d@gmail.com
Posts: 5
Joined: June 10th, 2008, 8:13 am

ok, issue has been resolved
a- "exists" spelling error
b- some xml file error "-" or "_" confusion.

thanks everyone
Post Reply