summaryrefslogtreecommitdiff
path: root/ext/standard/tests/file/bug77552.phpt
blob: 9404b8e09fb2e0c1eba56f6c19dbaa5ebd009b91 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
--TEST--
Bug #77552 Unintialized php_stream_statbuf in stat functions 
--SKIPIF--
<?php
if (substr(PHP_OS, 0, 3) != 'WIN') {
    die('skip windows only test');
}
?>
--FILE--
<?php
// Check lstat on a Windows junction to ensure that st_mode is zero
$tmpDir = __DIR__.'/test-bug77552';

$target = $tmpDir.'/folder/target';
mkdir($target, 0777, true);

$junction = $tmpDir.'/junction';
$cmd = sprintf('mklink /J "%s" "%s"', $junction, $target); 
exec($cmd);

$stat = lstat($junction);
var_dump($stat['mode']);

?>
--CLEAN--
<?php
$tmpDir = __DIR__.'/test-bug77552';
$cmd = sprintf('rmdir /S /Q "%s"', $tmpDir);
exec($cmd);
?>
--EXPECT--
int(0)