os_stat.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file    os_stat.h
00006  *
00007  *  data returned by the stat() function
00008  *
00009  *  os_stat.h,v 1.14 2006/06/07 08:25:03 jwillemsen Exp
00010  *
00011  *  @author Don Hinton <dhinton@dresystems.com>
00012  *  @author This code was originally in various places including ace/OS.h.
00013  */
00014 //=============================================================================
00015 
00016 #ifndef ACE_OS_INCLUDE_SYS_OS_STAT_H
00017 #define ACE_OS_INCLUDE_SYS_OS_STAT_H
00018 
00019 #include /**/ "ace/pre.h"
00020 
00021 #include "ace/config-lite.h"
00022 
00023 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00024 # pragma once
00025 #endif /* ACE_LACKS_PRAGMA_ONCE */
00026 
00027 #include "ace/os_include/sys/os_types.h"
00028 
00029 #if defined (ACE_WIN32) && !defined (ACE_HAS_WINCE)
00030 #  include /**/ <direct.h>
00031 #endif /* ACE_WIN32 && !ACE_HAS_WINCE */
00032 
00033 #if !defined (ACE_LACKS_SYS_STAT_H)
00034 #  include /**/ <sys/stat.h>
00035 #endif /* !ACE_LACKS_SYS_STAT_H */
00036 
00037 // Place all additions (especially function declarations) within extern "C" {}
00038 #ifdef __cplusplus
00039 extern "C"
00040 {
00041 #endif /* __cplusplus */
00042 
00043 #if defined (ACE_LACKS_MODE_MASKS)
00044 // MODE MASKS
00045 
00046 // the following macros are for POSIX conformance.
00047 
00048 #  if !defined (ACE_HAS_USER_MODE_MASKS)
00049 #    define S_IRWXU 00700         /* read, write, execute: owner. */
00050 #    define S_IRUSR 00400         /* read permission: owner. */
00051 #    define S_IWUSR 00200         /* write permission: owner. */
00052 #    define S_IXUSR 00100         /* execute permission: owner. */
00053 #  endif /* ACE_HAS_USER_MODE_MASKS */
00054 #  define S_IRWXG 00070           /* read, write, execute: group. */
00055 #  define S_IRGRP 00040           /* read permission: group. */
00056 #  define S_IWGRP 00020           /* write permission: group. */
00057 #  define S_IXGRP 00010           /* execute permission: group. */
00058 #  define S_IRWXO 00007           /* read, write, execute: other. */
00059 #  define S_IROTH 00004           /* read permission: other. */
00060 #  define S_IWOTH 00002           /* write permission: other. */
00061 #  define S_IXOTH 00001           /* execute permission: other. */
00062 
00063 // WinCE's S_IFLNK is defined with the other bits, below.
00064 #if !defined (S_IFLNK) && !defined (ACE_HAS_WINCE)
00065 #define S_IFLNK 0200000
00066 #endif /* S_IFLNK && !ACE_HAS_WINCE */
00067 
00068 #endif /* ACE_LACKS_MODE_MASKS */
00069 
00070 // Some systems (VxWorks) don't define S_ISLNK
00071 #if !defined (S_ISLNK)
00072 # if defined (S_IFLNK)
00073 #   define S_ISLNK(mode) (((mode)&S_IFLNK) == S_IFLNK)
00074 # else
00075 #   define S_ISLNK(mode) 0
00076 # endif /* S_IFLNK */
00077 #endif /* S_ISLNK */
00078 
00079 #if defined (ACE_HAS_WINCE)
00080 #  include "ace/Time_Value.h"
00081 
00082 // Translate the WinCE bits into names expected by our callers.
00083 // The dwFileAttributes parameter doesn't have protection info, so
00084 // S_IFMT is the whole thing. Since there are no symbolic links, S_IFLNK is 0.
00085 #  define S_IFMT 0xFFFF
00086 #  define S_IFDIR FILE_ATTRIBUTE_DIRECTORY
00087 #  define S_IFREG FILE_ATTRIBUTE_NORMAL
00088 #  define S_IFLNK 0
00089 
00090    struct stat
00091    {
00092       /// always 0 on Windows platforms
00093       dev_t st_dev;
00094 
00095       /// always 0 on Windows platforms
00096       dev_t st_rdev;
00097 
00098       /// file attribute
00099       unsigned short st_mode;
00100 
00101       /// number of hard links
00102       short st_nlink;
00103 
00104       /// time of last access
00105       ACE_Time_Value st_atime;
00106 
00107       /// time of last data modification
00108       ACE_Time_Value st_mtime;
00109 
00110       /// time of creation
00111       ACE_Time_Value st_ctime;
00112 
00113       /// file size, in bytes
00114       off_t st_size;
00115 
00116       // Following members do not have direct conversion in Window platforms.
00117       //u_long st_blksize;        // optimal blocksize for I/O
00118       //u_long st_flags;          // user defined flags for file
00119    };
00120 #endif /* ACE_HAS_WINCE */
00121 
00122 #ifdef __cplusplus
00123 }
00124 #endif /* __cplusplus */
00125 
00126 #include /**/ "ace/post.h"
00127 #endif /* ACE_OS_INCLUDE_SYS_OS_STAT_H */

Generated on Thu Nov 9 09:41:58 2006 for ACE by doxygen 1.3.6