src/main/php/file/FileOutputStream.php
protected function openFile(string $file, string $mode)
    {
        $fp = @fopen($file, $mode);
        if (false === $fp) {
            throw new StreamException(
                    'Can not open file ' . $file . ' with mode ' . $mode . ': '
                    .
                    str_replace('fopen(' . $file . '): ', '', lastErrorMessage())
            );
        }

        return $fp;
    }
protected function openFile(string $file, string $mode)
    {
        $fp = @fopen($file, $mode);
        if (false === $fp) {
            throw new StreamException(
                    'Can not open file ' . $file . ' with mode ' . $mode . ': '
                    .
                    str_replace('fopen(' . $file . '): ', '', lastErrorMessage())
            );
        }

        return $fp;
    }
protected function openFile ( string $ file , string $ mode ) { $ fp = @ fopen ( $ file , $ mode ) ; if ( false === $ fp ) { throw new StreamException ( 'Can not open file ' . $ file . ' with mode ' . $ mode . ': ' . str_replace ( 'fopen(' . $ file . '): ' , '' , lastErrorMessage ( ) ) ) ; } return $ fp ; }
helper method to open a file handle

@param   string   $file
@param   string   $mode
@return  resource
@throws  \stubbles\streams\StreamException
helper method to open a file handle