53 $this->_mode = $writable ?
'w+b' :
'rb';
54 $this->_quotes = get_magic_quotes_runtime();
75 public function read($length)
82 set_magic_quotes_runtime(0);
84 $bytes = fread($fp, $length);
87 set_magic_quotes_runtime(1);
89 $this->_offset = ftell($fp);
105 if (isset($this->_reader))
107 fseek($this->_reader, $byteOffset, SEEK_SET);
109 $this->_offset = $byteOffset;
129 if (!isset($this->_reader))
131 if (!$this->_reader = fopen($this->_path,
'rb'))
134 'Unable to open file for reading [' . $this->_path .
']'
137 fseek($this->_reader, $this->_offset, SEEK_SET);
145 if (!isset($this->_writer))
147 if (!$this->_writer = fopen($this->_path, $this->_mode))
150 'Unable to open file for writing [' . $this->_path .
']'
160 if (isset($this->_writer))
162 fclose($this->_writer);
163 $this->_writer = null;
170 if (isset($this->_reader))
172 fclose($this->_reader);
173 $this->_reader = null;