in reply to How to determine a file's type via stat()

stat will return a 13 element array. Element 2 is file mode (type and permissions).
If, however, you are aware of the type that the file should be...just use the file test operators:
-f, plain file
-d, directory
-l, symbolic link
etc...
HTH, Chris
Update: Well, while I was looking away...everybody already said this. Sorry for the repetition.
  • Comment on Re: How to determine a file's type via stat()