home *** CD-ROM | disk | FTP | other *** search
/ System Booster / System Booster.iso / Texteditors / Origami / Sources / src / lib / filetyp.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-09-27  |  553 b   |  32 lines

  1. /*{{{}}}*/
  2. /*{{{  #includes*/
  3. #ifdef CONFIG_H
  4. #   include "config.h"
  5. #endif
  6.  
  7. #include <sys/types.h>
  8. #include <unistd.h>
  9. #include <limits.h>
  10. #include <sys/stat.h>
  11. #include <string.h>
  12. #include <stdlib.h>
  13. #include <stdio.h>
  14.  
  15. #include <lib/ori_bool.h>
  16. #include <lib/ori_add_lib.h>
  17. /*}}}  */
  18.  
  19. /*{{{  is_file*/
  20. boolean is_file(FILE * const f,char const * const name)
  21. { struct stat buff;
  22.  
  23.    return
  24.     (   (    (f    && !fstat(fileno(f),&buff))
  25.           || (name && !stat(name,&buff))
  26.         )
  27.       ? !S_ISDIR(buff.st_mode)
  28.       : True
  29.     );
  30. }
  31. /*}}}  */
  32.