public function findOne($condition, $recursive = false)
    {
        $iterator = $this->appendIterator(
            function ($path) use ($condition, $recursive) {
                return Filesystem::find((string) $path, $condition, $recursive);
            }
        );

        $iterator->rewind();

        return $iterator->current();
    }
public function findOne($condition, $recursive = false)
    {
        $iterator = $this->appendIterator(
            function ($path) use ($condition, $recursive) {
                return Filesystem::find((string) $path, $condition, $recursive);
            }
        );

        $iterator->rewind();

        return $iterator->current();
    }
public function findOne ( $ condition , $ recursive = false ) { $ iterator = $ this -> appendIterator ( function ( $ path ) use ( $ condition , $ recursive ) { return Filesystem :: find ( ( string ) $ path , $ condition , $ recursive ) ; } ) ; $ iterator -> rewind ( ) ; return $ iterator -> current ( ) ; }
Find one file from all paths.

@param  mixed   $condition      Finding condition, that can be a string, a regex or a callback function.
Callback example:
<code>
function($current, $key, $iterator)
{
return @preg_match('^Foo', $current->getFilename())  && ! $iterator->isDot();
}
</code>
@param  boolean $recursive      True to resursive.

@return  \SplFileInfo  Finded file info object.

@since  2.0
Find one file from all paths .