Re: popen no devuelve FALSE
| From: | Àngel Fenoy | Date: | Fri, 06 Sep 2002 16:04:33 +0000 |
| Subject: | Re: popen no devuelve FALSE | ||
| References: | 1 2 3 | Groups: | php.general.es |
| Request: | Send a blank email to general-es+get-26559@lists.php.net to get a copy of this message | ||
Divendres Setembre 6 2002 07:47, Erik Torres Serrano dixit:
> Lista,
>
> estoy teniendo un problemita muy raro con la funcion popen. Cuando la
> uso en el siguiente codigo:
>
> $fp = popen("/bin/ls","r") or die("ERROR");
>
> Supongamos que /bin/ls no existe, el programa deberia abortar mostrando
> el mensaje de error. Sin embargo no sucede asi. La variable $fp esta
> tomando el valor: Resource id #1, aun cuando trate de levantar un
> programa que no existe. Sin embargo, el manual dice que debia tomar el
> valor FALSE. Alguna ayuda?
¿Qué versión del manual tienes? En el mio dice:
Note: If the command to be executed could not be found, a valid resource is
returned. This may seem odd, but makes sense; it allows you to access any
error message returned by the shell:
Y sigue un ejemplo explicativo...
Saludos
Àngel