xref: /PHP-8.2/ext/standard/tests/file/mkdir-002.phpt (revision 7edc5e5e)
1--TEST--
2mkdir(dir, 0777) tests
3--SKIPIF--
4<?php
5if (substr(PHP_OS, 0, 3) == 'WIN') {
6    die('skip not for Windows');
7}
8?>
9--FILE--
10<?php
11
12var_dump(mkdir("mkdir-002", 0777));
13var_dump(mkdir("mkdir-002/subdir", 0777));
14var_dump(`ls -l mkdir-002`);
15var_dump(rmdir("mkdir-002/subdir"));
16var_dump(rmdir("mkdir-002"));
17
18var_dump(mkdir("./mkdir-002", 0777));
19var_dump(mkdir("./mkdir-002/subdir", 0777));
20var_dump(`ls -l ./mkdir-002`);
21var_dump(rmdir("./mkdir-002/subdir"));
22var_dump(rmdir("./mkdir-002"));
23
24var_dump(mkdir(__DIR__."/mkdir-002", 0777));
25var_dump(mkdir(__DIR__."/mkdir-002/subdir", 0777));
26$dirname = __DIR__."/mkdir-002";
27var_dump(`ls -l $dirname`);
28var_dump(rmdir(__DIR__."/mkdir-002/subdir"));
29var_dump(rmdir(__DIR__."/mkdir-002"));
30
31echo "Done\n";
32?>
33--EXPECTF--
34bool(true)
35bool(true)
36string(%d) "%s
37d%s subdir
38"
39bool(true)
40bool(true)
41bool(true)
42bool(true)
43string(%d) "%s
44d%s subdir
45"
46bool(true)
47bool(true)
48bool(true)
49bool(true)
50string(%d) "%s
51d%s subdir
52"
53bool(true)
54bool(true)
55Done
56