php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #81031 DirectoryIterator show duplicate listing on mergerfs
Submitted: 2021-05-11 22:35 UTC Modified: -
From: wowkise at gmail dot com Assigned:
Status: Open Package: *Directory/Filesystem functions
PHP Version: Irrelevant OS: Linux
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2021-05-11 22:35 UTC] wowkise at gmail dot com
Description:
------------
Using DirectoryIterator on path that uses mergerfs[1] as underlying fs system causes the returned results to be duplicated.

Using other file system related scan function does not show the same problems. i.e. scandir works perfectly.

1: https://github.com/trapexit/mergerfs

Test script:
---------------
php -r 'foreach( new DirectoryIterator('/path/to/mergerfs') as $it) echo $it->getFilename().PHP_EOL;'

Expected result:
----------------
dir1
dir2
dir3


Actual result:
--------------
dir1
dir2
dir3
dir1
dir2
dir3

Patches

Add a Patch

Pull Requests

Add a Pull Request

 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Fri Oct 22 10:03:33 2021 UTC