title: Differentiate between a unix directory and file in C and C++
body: <p>Given a path, say, /home/shree/path/def, I would want to determine if def is a directory or a file.  Is there a way of achieving this in C or C++ code?</p>