home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume8 / help.jn / mymode.c < prev    next >
Encoding:
C/C++ Source or Header  |  1989-08-19  |  335 b   |  23 lines

  1. #include <stdio.h>
  2. #include <sys/types.h>
  3. #include <sys/stat.h>
  4.  
  5. mymode(p)
  6. char *p;
  7. {
  8.  
  9.     struct stat buf;
  10.     struct stat *pb = &buf;
  11. #ifndef SYSV
  12.     if(lstat(p,pb)== -1)
  13. #else
  14.     if(stat(p,pb)== -1)
  15. #endif
  16.     {
  17. /*        fprintf(stderr,"lstat: %s not found\n",p);*/
  18.         return 0;
  19.     }
  20. /*    fprintf(stderr,"mode=%o\n",pb->st_mode);*/
  21.     return pb->st_mode;
  22. }
  23.