pclose
int
pclose は「元に戻す」が不可能、「照会」が不可能、「編集」が不可能です。
popen で開いたパイプを閉じ、問題がない場合はゼロ、エラーが発生した場合はゼロ以外を返します。int | エラー コード |
// Unix specific example. Note: if you really want to get a directory // listing, please use the "getFileList" command instead. This is just // used as a simple example. // $pipe = popen( "ls -1", "r" ); string $dirList[]; while ( !feof( $pipe ) ) { $dirList[size( $dirList )] = fgetline( $pipe ); } pclose( $pipe ); // Windows specific example. Note: if you really want to get a directory // listing, please use the "getFileList" command instead. This is just // used as a simple example. // $pipe = popen( "DIR /B", "r" ); string $dirList[]; while ( !feof( $pipe ) ) { $dirList[size( $dirList )] = fgetline( $pipe ); } pclose( $pipe );