Ver Mensaje Individual
  #4 (permalink)  
Antiguo 26/08/2009, 14:52
guzmih
 
Fecha de Ingreso: abril-2008
Mensajes: 7
Antigüedad: 16 años
Puntos: 0
Exclamación Respuesta: problema funcion

Pues mirad esque lo que da el error es un script prefabricado que es para subir archivos y bajar de servidores y tambien da la opcion de comprimir. Y lo baje de la web oficial y ademas e probado con otros bajados d otros sitio y me pasa igual y es que al ser asi por eso me extraña el error en la programacion.

el codigo de la parte que d error es esta:

Código:
  $pos_found_s = '';
        while (!feof($rar_pipes[2])) {
          $this->rar_error .= fgets($rar_pipes[2], 8);
          $pos_s_ = strpos($this->rar_error, 'Adding', $pos_s+1);
          if ($pos_s_ === false) { $pos_s_ = strpos($this->rar_error, 'Testing', $pos_s+1); }
          if ($pos_s_ === false) { $pos_s_ = strpos($this->rar_error, 'Calculating the control sum', $pos_s+1); }
          if ($pos_s_ === false) { $pos_s_ = strpos($this->rar_error, 'Testing archive', $pos_s+1); }
          if ($pos_s_ === false) { $pos_s_ = strpos($this->rar_error, 'Creating archive', $pos_s+1); }
          if ($pos_s_ !== false) { $pos_s = $pos_s_; $pos_found_s = true; }
          $pos = strrpos($this->rar_error, "%", $pos_last + 1);
          if ($pos !== false && $pos_last !== $pos) {
            $pos_last = $pos;
            $num = trim(substr($this->rar_error, $pos - 3, 3));
            if ($num_last !== $num) {
              $num_last = $num;
              if ($pos_found_s === true) {
                $pos_found_s = trim(substr($this->rar_error, $pos_s, strpos($this->rar_error, "%", $pos_s) - $pos_s - 7));
                $pos_tmp[0] = strpos($pos_found_s, '...');
                if ($pos_tmp[0] !== false) {
                  $pos_tmp[1] = strpos($pos_found_s, 'Creating archive');
                  if ($pos_tmp[1] === 0) { $pos_found_s = 'Adding     '.trim(substr($pos_found_s, $pos_tmp[0] + 3)); }
                  else {
                    $pos_tmp[1] = strpos($pos_found_s, 'Testing archive');
                    if ($pos_tmp[1] === 0) { $pos_found_s = 'Testing     '.trim(substr($pos_found_s, $pos_tmp[0] + 3)); }
                  }
                }
                $pos_tmp[0] = strpos($pos_found_s, 'Adding');
                if ($pos_tmp[0] === 0) { $pos_found_s = 'Adding     '.basename(substr($pos_found_s, 11)); }
                $pos_tmp[0] = strpos($pos_found_s, 'Testing');
                if ($pos_tmp[0] === 0) { $pos_found_s = 'Testing     '.basename(substr($pos_found_s, 12)); }
                $pos_found_s = str_replace(array("\r\n", "\n", "\r"), '' , $pos_found_s);
              }
              echo "<script type=\"text/javascript\">rar_st('".$jsoutid."', '".addslashes($pos_found_s).' '.$num_last."%')</script>\r\n";
              flush();
              if ($num_last == 100) { $pos_found_s = ''; }
            }
          }
        }
      }
      else {
        $this->rar_error = '';
        while (!feof($rar_pipes[2])) { $this->rar_error .= fread($rar_pipes[2], 8192); }
        $this->rar_error = trim($this->rar_error);
      }
      fclose($rar_pipes[2]);
      $this->rar_return = proc_close($rar_process);
    }
    else {
      $this->rar_error = 'Error openning rar process';
      $this->rar_return = 0;
    }
    if ($this->debug) {
      echo "-----<br>\r\n";
      echo nl2br(str_replace(" ", "&nbsp;", $this->rar_return))."<br>\r\n";
      echo "---<br>\r\n";
      echo nl2br(str_replace(" ", "&nbsp;", $this->rar_error))."<br>\r\n";
      echo "---<br>\r\n";
      if (is_array($this->rar_list)) { foreach ($this->rar_list as $line) { echo nl2br(str_replace(" ", "&nbsp;", htmlentities($line)))."<br>\r\n"; } }
      echo "---<br>\r\n";
      echo htmlentities("'".$this->rar_exec."' ".$params.' '.$this->rar_forbidden.' -- '.escapeshellarg($this->filename).' '.$extra)."<br>\r\n";
      echo "-----<br>\r\n<br>\r\n<br>\r\n<br>\r\n";
    }
  }
}
?>
¨Y es que el script en la web oficial y gente lo tiene funcionando perfectament en php5 que es lo que yo uso...no se si quizas debo modificar algun parametro en la configuracion u algo la verdad que no se porque lanza el error ya que le pongo en su carpeta segun las intruccion el rar para linux todo con sus permisos y....
Como Sistema operativo una Gentoo

saludos y millones de gracias