Task #52668 » chmodTest.php

Michiel Roos, 2014-01-12 10:38

 
1
<?php
2

    
3
$mode = 0664;
4

    
5
$now = microtime();
6
$filename = '/Users/michiel/wb/WebRoot/6.2.master.workbench.local/fileadmin/' . $now . '.txt';
7
file_put_contents($filename, 'lala');
8
chmod($filename, $mode);
9
var_dump(fileperms($filename));
10

    
11
$now = microtime();
12
$filename = '/Users/michiel/wb/WebRoot/6.2.master.workbench.local/fileadmin/' . $now . '.txt';
13
file_put_contents($filename, 'lala');
14
chmod($filename, octdec($mode));
15
var_dump(fileperms($filename));
16

    
17
$mode = '0664';
18

    
19
$now = microtime();
20
$filename = '/Users/michiel/wb/WebRoot/6.2.master.workbench.local/fileadmin/' . $now . '.txt';
21
file_put_contents($filename, 'lala');
22
chmod($filename, $mode);
23
var_dump(fileperms($filename));
24

    
25
$now = microtime();
26
$filename = '/Users/michiel/wb/WebRoot/6.2.master.workbench.local/fileadmin/' . $now . '.txt';
27
file_put_contents($filename, 'lala');
28
chmod($filename, octdec($mode));
29
var_dump(fileperms($filename));
(1-1/2)