View Full Version : check if file texture exists - filetest?

04 April 2006, 12:56 AM
i need to check if various file textures exist in the sourceimages directory to get a true or false return. i tried using the filetest command but no matter what it always returns 0 even though the file i'm querying does exist. i have tried

filetest -w filename.extentsion;
filetest -w filename;
filetest -w ("\sourceimages\filename.extension");
filetest -w "filename.extension";

am i using this command wrong? can anyone think of another way to check if a file exists?


04 April 2006, 08:01 AM
I looks like you simple need to provide the command with the full path to the file.... something like....

filetest -f "E:/maya/projects/default/sourceimages/test.tif"; Make sure to use forward slashes or double backslashes in your path string....


Blue Bird
04 April 2006, 08:05 AM
try file -q -ex $filename or filetest -f $filename instead

04 April 2006, 05:05 PM
just tried both those flags, as well as the absolute path but to no success. I'm guessing that our version control software might have something to do with the false return. at home i tried 'filetest -f filename.ext' and it worked fine. if the version control wont let me query the files because of my permissions or whatever then hopefully i can think of another way to look for null files.

edit: problem solved. thanks for the help.

absolute path worked but using backslash - filetest -f "c:/maya/file"

CGTalk Moderation
04 April 2006, 05:05 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.