php_filestat.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. /*
  2. +----------------------------------------------------------------------+
  3. | PHP Version 7 |
  4. +----------------------------------------------------------------------+
  5. | Copyright (c) 1997-2018 The PHP Group |
  6. +----------------------------------------------------------------------+
  7. | This source file is subject to version 3.01 of the PHP license, |
  8. | that is bundled with this package in the file LICENSE, and is |
  9. | available through the world-wide-web at the following url: |
  10. | http://www.php.net/license/3_01.txt |
  11. | If you did not receive a copy of the PHP license and are unable to |
  12. | obtain it through the world-wide-web, please send a note to |
  13. | license@php.net so we can mail you a copy immediately. |
  14. +----------------------------------------------------------------------+
  15. | Author: Jim Winstead <jimw@php.net> |
  16. +----------------------------------------------------------------------+
  17. */
  18. #ifndef PHP_FILESTAT_H
  19. #define PHP_FILESTAT_H
  20. PHP_RINIT_FUNCTION(filestat);
  21. PHP_RSHUTDOWN_FUNCTION(filestat);
  22. PHP_FUNCTION(realpath_cache_size);
  23. PHP_FUNCTION(realpath_cache_get);
  24. PHP_FUNCTION(clearstatcache);
  25. PHP_FUNCTION(fileatime);
  26. PHP_FUNCTION(filectime);
  27. PHP_FUNCTION(filegroup);
  28. PHP_FUNCTION(fileinode);
  29. PHP_FUNCTION(filemtime);
  30. PHP_FUNCTION(fileowner);
  31. PHP_FUNCTION(fileperms);
  32. PHP_FUNCTION(filesize);
  33. PHP_FUNCTION(filetype);
  34. PHP_FUNCTION(is_writable);
  35. PHP_FUNCTION(is_readable);
  36. PHP_FUNCTION(is_executable);
  37. PHP_FUNCTION(is_file);
  38. PHP_FUNCTION(is_dir);
  39. PHP_FUNCTION(is_link);
  40. PHP_FUNCTION(file_exists);
  41. PHP_NAMED_FUNCTION(php_if_stat);
  42. PHP_NAMED_FUNCTION(php_if_lstat);
  43. PHP_FUNCTION(disk_total_space);
  44. PHP_FUNCTION(disk_free_space);
  45. PHP_FUNCTION(chown);
  46. PHP_FUNCTION(chgrp);
  47. #if HAVE_LCHOWN
  48. PHP_FUNCTION(lchown);
  49. #endif
  50. #if HAVE_LCHOWN
  51. PHP_FUNCTION(lchgrp);
  52. #endif
  53. PHP_FUNCTION(chmod);
  54. #if HAVE_UTIME
  55. PHP_FUNCTION(touch);
  56. #endif
  57. PHP_FUNCTION(clearstatcache);
  58. #ifdef PHP_WIN32
  59. #define S_IRUSR S_IREAD
  60. #define S_IWUSR S_IWRITE
  61. #define S_IXUSR S_IEXEC
  62. #define S_IRGRP S_IREAD
  63. #define S_IWGRP S_IWRITE
  64. #define S_IXGRP S_IEXEC
  65. #define S_IROTH S_IREAD
  66. #define S_IWOTH S_IWRITE
  67. #define S_IXOTH S_IEXEC
  68. #undef getgid
  69. #define getgroups(a, b) 0
  70. #define getgid() 1
  71. #define getuid() 1
  72. #endif
  73. /* Compatibility. */
  74. typedef size_t php_stat_len;
  75. PHPAPI void php_clear_stat_cache(zend_bool clear_realpath_cache, const char *filename, size_t filename_len);
  76. PHPAPI void php_stat(const char *filename, size_t filename_length, int type, zval *return_value);
  77. /* Switches for various filestat functions: */
  78. #define FS_PERMS 0
  79. #define FS_INODE 1
  80. #define FS_SIZE 2
  81. #define FS_OWNER 3
  82. #define FS_GROUP 4
  83. #define FS_ATIME 5
  84. #define FS_MTIME 6
  85. #define FS_CTIME 7
  86. #define FS_TYPE 8
  87. #define FS_IS_W 9
  88. #define FS_IS_R 10
  89. #define FS_IS_X 11
  90. #define FS_IS_FILE 12
  91. #define FS_IS_DIR 13
  92. #define FS_IS_LINK 14
  93. #define FS_EXISTS 15
  94. #define FS_LSTAT 16
  95. #define FS_STAT 17
  96. #endif /* PHP_FILESTAT_H */