protected function open($filename, $flags)
    {
        if (is_file($filename) === false || ($this->file = fopen($filename, $flags)) === false) {
            throw new Exception('Unable to open the target file.');
        }
    }