Back to index

php5  5.3.10
php_filestat.h
Go to the documentation of this file.
00001 /*
00002    +----------------------------------------------------------------------+
00003    | PHP Version 5                                                        |
00004    +----------------------------------------------------------------------+
00005    | Copyright (c) 1997-2012 The PHP Group                                |
00006    +----------------------------------------------------------------------+
00007    | This source file is subject to version 3.01 of the PHP license,      |
00008    | that is bundled with this package in the file LICENSE, and is        |
00009    | available through the world-wide-web at the following url:           |
00010    | http://www.php.net/license/3_01.txt                                  |
00011    | If you did not receive a copy of the PHP license and are unable to   |
00012    | obtain it through the world-wide-web, please send a note to          |
00013    | license@php.net so we can mail you a copy immediately.               |
00014    +----------------------------------------------------------------------+
00015    | Author:  Jim Winstead <jimw@php.net>                                 |
00016    +----------------------------------------------------------------------+
00017 */
00018 
00019 /* $Id: php_filestat.h 321634 2012-01-01 13:15:04Z felipe $ */
00020 
00021 #ifndef PHP_FILESTAT_H
00022 #define PHP_FILESTAT_H
00023 
00024 PHP_RINIT_FUNCTION(filestat);
00025 PHP_RSHUTDOWN_FUNCTION(filestat);
00026 
00027 PHP_FUNCTION(realpath_cache_size);
00028 PHP_FUNCTION(realpath_cache_get);
00029 PHP_FUNCTION(clearstatcache);
00030 PHP_FUNCTION(fileatime);
00031 PHP_FUNCTION(filectime);
00032 PHP_FUNCTION(filegroup);
00033 PHP_FUNCTION(fileinode);
00034 PHP_FUNCTION(filemtime);
00035 PHP_FUNCTION(fileowner);
00036 PHP_FUNCTION(fileperms);
00037 PHP_FUNCTION(filesize);
00038 PHP_FUNCTION(filetype);
00039 PHP_FUNCTION(is_writable);
00040 PHP_FUNCTION(is_readable);
00041 PHP_FUNCTION(is_executable);
00042 PHP_FUNCTION(is_file);
00043 PHP_FUNCTION(is_dir);
00044 PHP_FUNCTION(is_link);
00045 PHP_FUNCTION(file_exists);
00046 PHP_NAMED_FUNCTION(php_if_stat);
00047 PHP_NAMED_FUNCTION(php_if_lstat);
00048 PHP_FUNCTION(disk_total_space);
00049 PHP_FUNCTION(disk_free_space);
00050 PHP_FUNCTION(chown);
00051 PHP_FUNCTION(chgrp);
00052 #if HAVE_LCHOWN
00053 PHP_FUNCTION(lchown);
00054 #endif
00055 #if HAVE_LCHOWN
00056 PHP_FUNCTION(lchgrp);
00057 #endif
00058 PHP_FUNCTION(chmod);
00059 #if HAVE_UTIME
00060 PHP_FUNCTION(touch);
00061 #endif
00062 PHP_FUNCTION(clearstatcache);
00063 
00064 #define MAKE_LONG_ZVAL_INCREF(name, val)\
00065        MAKE_STD_ZVAL(name); \
00066        ZVAL_LONG(name, val); \
00067        Z_ADDREF_P(name); 
00068 
00069 #ifdef PHP_WIN32
00070 #define S_IRUSR S_IREAD
00071 #define S_IWUSR S_IWRITE
00072 #define S_IXUSR S_IEXEC
00073 #define S_IRGRP S_IREAD
00074 #define S_IWGRP S_IWRITE
00075 #define S_IXGRP S_IEXEC
00076 #define S_IROTH S_IREAD
00077 #define S_IWOTH S_IWRITE
00078 #define S_IXOTH S_IEXEC
00079 
00080 #undef getgid
00081 #define getgroups(a, b) 0
00082 #define getgid() 1
00083 #define getuid() 1
00084 #endif
00085 
00086 #ifdef PHP_WIN32
00087 typedef unsigned int php_stat_len;
00088 #else
00089 typedef int php_stat_len;
00090 #endif
00091 
00092 PHPAPI void php_clear_stat_cache(zend_bool clear_realpath_cache, const char *filename, int filename_len TSRMLS_DC);
00093 PHPAPI void php_stat(const char *filename, php_stat_len filename_length, int type, zval *return_value TSRMLS_DC);
00094 
00095 /* Switches for various filestat functions: */
00096 #define FS_PERMS    0
00097 #define FS_INODE    1
00098 #define FS_SIZE     2
00099 #define FS_OWNER    3
00100 #define FS_GROUP    4
00101 #define FS_ATIME    5
00102 #define FS_MTIME    6
00103 #define FS_CTIME    7
00104 #define FS_TYPE     8
00105 #define FS_IS_W     9
00106 #define FS_IS_R    10
00107 #define FS_IS_X    11
00108 #define FS_IS_FILE 12
00109 #define FS_IS_DIR  13
00110 #define FS_IS_LINK 14
00111 #define FS_EXISTS  15
00112 #define FS_LSTAT   16
00113 #define FS_STAT    17
00114 
00115 #endif /* PHP_FILESTAT_H */