dir_bug73971.phpt 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. --TEST--
  2. Bug #73971 Filename got limited to MAX_PATH on Win32 when scan directory
  3. --SKIPIF--
  4. <?php
  5. if (substr(PHP_OS, 0, 3) != 'WIN') {
  6. die("skip Valid only on Windows");
  7. }
  8. ?>
  9. --FILE--
  10. <?php
  11. $base = __DIR__ . DIRECTORY_SEPARATOR . "bug73971";
  12. $filename = $base . DIRECTORY_SEPARATOR . str_repeat('テスト', 48); // 144 glyph here, less than 256
  13. mkdir($base);
  14. mkdir($filename); // created correctly
  15. var_dump(basename($filename)); // 432 bytes here, more than 256
  16. echo "\ntest dir()\n";
  17. $d = dir($base);
  18. while (false !== ($entry = $d->read())) {
  19. var_dump($entry);
  20. }
  21. $d->close();
  22. echo "\ntest DirectoryIterator\n";
  23. $dir = new DirectoryIterator($base);
  24. foreach ($dir as $finfo) {
  25. var_dump($finfo->getFilename());
  26. }
  27. ?>
  28. --CLEAN--
  29. <?php
  30. $base = __DIR__ . DIRECTORY_SEPARATOR . "bug73971";
  31. $filename = $base . DIRECTORY_SEPARATOR . str_repeat('テスト', 48);
  32. rmdir($filename);
  33. rmdir($base);
  34. ?>
  35. --EXPECT--
  36. string(432) "テストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテスト"
  37. test dir()
  38. string(1) "."
  39. string(2) ".."
  40. string(432) "テストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテスト"
  41. test DirectoryIterator
  42. string(1) "."
  43. string(2) ".."
  44. string(432) "テストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテスト"