In my program, I am using opendir() to read in the names of text files from a directory. How can I tell whether a file is text or an object file ? Is there a better way than using : system("file filename > /tmp/tempfile") Thanks, Po