home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 9 Archive / 09-Archive.zip / zip22.zip / cmsmvs / cstat.h < prev    next >
C/C++ Source or Header  |  1996-12-14  |  2KB  |  56 lines

  1. /*
  2.  
  3.  Copyright (C) 1990-1996 Mark Adler, Richard B. Wales, Jean-loup Gailly,
  4.  Kai Uwe Rommel, Onno van der Linden, George Petrov and Igor Mandrichenko.
  5.  Permission is granted to any individual or institution to use, copy, or
  6.  redistribute this software so long as all of the original files are included,
  7.  that it is not sold for profit, and that this copyright notice is retained.
  8.  
  9. */
  10.  
  11. /*  cstat.h
  12.  
  13.     Definitions used for file status functions
  14.  
  15. */
  16.  
  17. #ifndef __STAT_H
  18. #define __STAT_H
  19.  
  20. #include <stdio.h>
  21.  
  22. #define S_IFMT  0xF000  /* file type mask */
  23. #define S_IFDIR 0x4000  /* directory */
  24. #define S_IFIFO 0x1000  /* FIFO special */
  25. #define S_IFCHR 0x2000  /* character special */
  26. #define S_IFBLK 0x3000  /* block special */
  27. #define S_IFREG 0x8000  /* or just 0x0000, regular */
  28. #define S_IREAD 0x0100  /* owner may read */
  29. #define S_IWRITE 0x0080 /* owner may write */
  30. #define S_IEXEC 0x0040  /* owner may execute <directory search> */
  31.  
  32. struct  stat
  33. {
  34.     short st_dev;      /* Drive number of disk containing the  */
  35.                        /* file or file handle if the file is   */
  36.                        /* on device                            */
  37.     short st_ino;      /* Not meaningfull for VM/CMS           */
  38.     short st_mode;     /* Bit mask giving information about    */
  39.                        /* the file's mode                      */
  40.     short st_nlink;    /* Set to the integer constant 1        */
  41.     int   st_uid;      /* Not meaningfull for VM/CMS           */
  42.     int   st_gid;      /* Not meaningfull for VM/CMS           */
  43.     short st_rdev;     /* Same as st_dev                       */
  44.     long  st_size;     /* Size of the file in bytes            */
  45.     long  st_atime;    /* Most recent access                   */
  46.     long  st_mtime;    /* Same as st_atime                     */
  47.     long  st_ctime;    /* Same as st_atime                     */
  48.     FILE  *fp;
  49.     char  fname[FILENAME_MAX];
  50. };
  51.  
  52. int stat(const char *path, struct stat *sb);
  53. int fstat(int fd, struct stat *sb);
  54.  
  55. #endif  /* __STAT_H */
  56.