1--TEST--
2Bug #30730 Filename path length limit broken on NTFS volume, using rename
3--SKIPIF--
4<?php
5include __DIR__ . DIRECTORY_SEPARATOR . "util.inc";
6
7skip_if_not_win();
8if (getenv("SKIP_SLOW_TESTS")) die("skip slow test");
9
10?>
11--FILE--
12<?php
13
14$dir = __DIR__ . DIRECTORY_SEPARATOR . "test_bug30730";
15$file = $dir . DIRECTORY_SEPARATOR . "test_file";
16
17var_dump(mkdir($dir));
18
19// Create a file in that directory
20
21$fp = fopen($file, 'wb+');
22fclose($fp);
23
24// Rename that directory in order that the file full path will be long enough to trigger the bug
25
26$dest_dir =str_pad($dir, 200, '0');
27$dest_file = $dest_dir . DIRECTORY_SEPARATOR . "test_file";
28
29var_dump(rename($dir, $dest_dir));
30
31var_dump(file_exists($dest_file));
32
33var_dump(unlink($dest_file));
34var_dump(rmdir($dest_dir));
35
36?>
37--EXPECT--
38bool(true)
39bool(true)
40bool(true)
41bool(true)
42bool(true)
43