Annotation of embedaddon/php/ext/standard/tests/file/chmod_basic.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: chmod() basic fuctionality
3: --SKIPIF--
4: <?php
5: if (substr(PHP_OS, 0, 3) == 'WIN') {
6: die('skip non-windows only test');
7: }
8: ?>
9: --FILE--
10: <?php
11:
12: define("MODE_MASK", 07777);
13:
14: $filename = __FILE__ . ".tmp";
15:
16: $fd = fopen($filename, "w+");
17: fclose($fd);
18:
19: for ($perms_to_set = 07777; $perms_to_set >= 0; $perms_to_set--) {
20: chmod($filename, $perms_to_set);
21: $set_perms = (fileperms($filename) & MODE_MASK);
22: clearstatcache();
23: if ($set_perms != $perms_to_set) {
24: printf("Error: %o does not match %o\n", $set_perms, $perms_to_set);
25: }
26: }
27: var_dump(chmod($filename, 0777));
28:
29: unlink($filename);
30: echo "done";
31:
32: ?>
33: --EXPECT--
34: bool(true)
35: done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>