PDA

View Full Version : Mel - File Test


stanmation
01-29-2009, 03:42 AM
Hi All

I'm trying to use 'filetest' command to check if the file already exists, but it always give me a value of 0 (false), whereas the file already exists in the same directory where I'm working. I just use `filetest -r $newName`; where $newName is the variable of the name that I'm trying to check.

Have anyone had this problem before? Not sure, but maybe it's because i'm working with sub folders (eg. /scenes/AssetName/SceneName/)

Thanks before

dbiggs
01-29-2009, 04:47 AM
Maybe you're using the wrong slashes? This little test works for me.

string $file = "C:/temp/test/test.txt";
filetest -r $file;
// Result: 1 //

DOor
01-29-2009, 04:38 PM
it sounds like you are not using a full path to specify the folder you want to search in.

stanmation
01-29-2009, 10:57 PM
Thanks David and Eric,

Yes, I wasn't using the full path because the situation is I tried to create a file using 'naming convention' melScript that I created. This 'naming convention' script worked well, but when I used 'filetest' command to test whether another file with same name exists in the same directory, it couldn't read it.

CGTalk Moderation
01-29-2009, 10:57 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.