public function valid()
    {
        if ($this->_resource === null && $this->_filename) {
            $this->_resource = fopen($this->_filename, $this->_mode);
        }
        return !!$this->_resource && is_resource($this->_resource);
    }