★ wanayoo — archive 1999 http://fr.php.net/manual/fr/function.pclose.phpNouvelle recherche | Portail wanayoo
PHP  
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
search for in the  
<pathinfopopen>
view the version of this page
Last updated: Tue, 06 Jan 2004

pclose

(PHP 3, PHP 4 )

pclose -- Ferme un processus de pointeur de fichier

Description

int pclose ( resource handle)

pclose() ferme un processus de pointeur de fichier ouvert par popen().

Le pointeur de fichier doit être valide, et avoir été ouvert correctement par popen().

pclose() retourne le statut final du processus exécuté.

Voir aussi popen().



add a note add a note User Contributed Notes
pclose
kcross at nssolutions dot com
16-Jul-2003 08:08
Somewhere between 4.1.1 and 4.2.3, the return value from pclose changed.

The exit status used to be in the second byte, so that the status would be (pclose($fp)/256).

It is now in the low-order byte, so the status is just pclose($fp).

Be careful.
vdweij at mailsurf dot com
12-Mar-2003 01:18
As I understand pclose will return 0 (on every platform) in case popen could not execute the specified command.

Since popen only returns the status wether it was able to send a command and not wether it was succesfully executed. Only the returned value of pclose can be used to check wether a command could be executed.
roel at bouwman dot net
07-Oct-1999 04:23
The return value of pclose() is not the exit status of the program, but a value as returned by waitpid() of wait4().

To obtain the exit status:

$ret=(pclose($f)>>8)&0xFF;

<pathinfopopen>
 Last updated: Tue, 06 Jan 2004
show source | credits | sitemap | contact | mirror sites 
Copyright © 2001-2004 The PHP Group
All rights reserved.
This mirror generously provided by: nexen.net
Last updated: Wed Jan 7 05:13:31 2004 CET