protected static function tempnamHandler($dir, $prefix, $cb, &$tries)
    {
        $cb = CallbackWrapper::forceWrap($cb);
        if (++$tries >= 3) {
            $cb(false);
            return;
        }
        $path = FileSystem::genRndTempnam($dir, $prefix);
        FileSystem::open($path, 'x+!', function ($file) use ($dir, $prefix, $cb, &$tries) {
            if (!$file) {
                static::tempnamHandler($dir, $prefix, $cb, $tries);
                return;
            }
            $cb($file);
        });
    }
protected static function tempnamHandler($dir, $prefix, $cb, &$tries)
    {
        $cb = CallbackWrapper::forceWrap($cb);
        if (++$tries >= 3) {
            $cb(false);
            return;
        }
        $path = FileSystem::genRndTempnam($dir, $prefix);
        FileSystem::open($path, 'x+!', function ($file) use ($dir, $prefix, $cb, &$tries) {
            if (!$file) {
                static::tempnamHandler($dir, $prefix, $cb, $tries);
                return;
            }
            $cb($file);
        });
    }
protected static function tempnamHandler ( $ dir , $ prefix , $ cb , & $ tries ) { $ cb = CallbackWrapper :: forceWrap ( $ cb ) ; if ( ++ $ tries >= 3 ) { $ cb ( false ) ; return ; } $ path = FileSystem :: genRndTempnam ( $ dir , $ prefix ) ; FileSystem :: open ( $ path , 'x+!' , function ( $ file ) use ( $ dir , $ prefix , $ cb , & $ tries ) { if ( ! $ file ) { static :: tempnamHandler ( $ dir , $ prefix , $ cb , $ tries ) ; return ; } $ cb ( $ file ) ; } ) ; }
Generates closure tempnam handler
@param  $dir
@param  $prefix
@param  $cb
@param  $tries
Generates closure tempnam handler