Skip to content

Latest commit

 

History

History
99 lines (85 loc) · 2.94 KB

File metadata and controls

99 lines (85 loc) · 2.94 KB
title ms.custom ms.date ms.reviewer ms.suite ms.technology ms.tgt_pltfrm ms.topic apiname apilocation apitype f1_keywords dev_langs helpviewer_keywords ms.assetid caps.latest.revision author ms.author manager translation.priority.ht
_pclose | Microsoft Docs
11/04/2016
devlang-cpp
article
_pclose
msvcrt.dll
msvcr80.dll
msvcr90.dll
msvcr100.dll
msvcr100_clr0400.dll
msvcr110.dll
msvcr110_clr0400.dll
msvcr120.dll
msvcr120_clr0400.dll
ucrtbase.dll
api-ms-win-crt-stdio-l1-1-0.dll
DLLExport
_pclose
pclose
C++
_pclose function
pclose function
pipes, closing
e2e31a9e-ba3a-4124-bcbb-c4040110b3d3
14
corob-msft
corob
ghogen
cs-cz
de-de
es-es
fr-fr
it-it
ja-jp
ko-kr
pl-pl
pt-br
ru-ru
tr-tr
zh-cn
zh-tw

_pclose

Waits for a new command processor and closes the stream on the associated pipe.

Important

This API cannot be used in applications that execute in the Windows Runtime. For more information, see CRT functions not supported with /ZW.

Syntax

  
      int _pclose(  
FILE *stream   
);  

Parameters

stream
Return value from the previous call to _popen.

Return Value

Returns the exit status of the terminating command processor, or –1 if an error occurs. The format of the return value is the same as that for _cwait, except the low-order and high-order bytes are swapped. If stream is NULL, _pclose sets errno to EINVAL and returns -1.

For information about these and other error codes, see _doserrno, errno, _sys_errlist, and _sys_nerr.

Remarks

The _pclose function looks up the process ID of the command processor (Cmd.exe) started by the associated _popen call, executes a _cwait call on the new command processor, and closes the stream on the associated pipe.

Requirements

Routine Required header
_pclose <stdio.h>

For more compatibility information, see Compatibility.

Libraries

All versions of the C run-time libraries.

.NET Framework Equivalent

Not applicable. To call the standard C function, use PInvoke. For more information, see Platform Invoke Examples.

See Also

Process and Environment Control
_pipe
_popen, _wpopen