public function write($str) { if (false === ($bytesWritten = fwrite($this->fileHandler, $str))) { throw new Exception("Writting to file failed! Probably, there is no more free space left?"); } return $bytesWritten; }