You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> This API cannot be used in applications that execute in the Windows Runtime. For more information, see [CRT functions not supported with /ZW](http://msdn.microsoft.com/library/windows/apps/jj606124.aspx).
69
-
70
-
## Syntax
71
-
72
-
```
73
-
74
-
FILE *_popen(
75
-
const char *command,
76
-
const char *mode
77
-
);
78
-
FILE *_wpopen(
79
-
const wchar_t *command,
80
-
const wchar_t *mode
81
-
);
82
-
```
83
-
84
-
#### Parameters
85
-
*command*
86
-
Command to be executed.
87
-
88
-
*mode*
89
-
Mode of the returned stream.
90
-
91
-
## Return Value
92
-
Returns a stream associated with one end of the created pipe. The other end of the pipe is associated with the spawned command's standard input or standard output. The functions return **NULL** on an error. If the error is an invalid parameter, such as if *command* or *mode* is a null pointer, or *mode* is not a valid mode, `errno` is set to `EINVAL`. See the Remarks section for valid modes.
93
-
94
-
For information about these and other error codes, see [_doserrno, errno, _sys_errlist, and _sys_nerr](../../c-runtime-library/errno-doserrno-sys-errlist-and-sys-nerr.md).
95
-
96
-
## Remarks
97
-
The `_popen` function creates a pipe and asynchronously executes a spawned copy of the command processor with the specified string *command*. The character string *mode* specifies the type of access requested, as follows.
98
-
99
-
**"r"**
100
-
The calling process can read the spawned command's standard output using the returned stream.
101
-
102
-
**"w"**
103
-
The calling process can write to the spawned command's standard input using the returned stream.
104
-
105
-
**"b"**
106
-
Open in binary mode.
107
-
108
-
**"t"**
109
-
Open in text mode.
110
-
68
+
> This API cannot be used in applications that execute in the Windows Runtime. For more information, see [CRT functions not supported with /ZW](http://msdn.microsoft.com/library/windows/apps/jj606124.aspx).
69
+
70
+
## Syntax
71
+
72
+
```
73
+
74
+
FILE *_popen(
75
+
const char *command,
76
+
const char *mode
77
+
);
78
+
FILE *_wpopen(
79
+
const wchar_t *command,
80
+
const wchar_t *mode
81
+
);
82
+
```
83
+
84
+
#### Parameters
85
+
*command*
86
+
Command to be executed.
87
+
88
+
*mode*
89
+
Mode of the returned stream.
90
+
91
+
## Return Value
92
+
Returns a stream associated with one end of the created pipe. The other end of the pipe is associated with the spawned command's standard input or standard output. The functions return **NULL** on an error. If the error is an invalid parameter, such as if *command* or *mode* is a null pointer, or *mode* is not a valid mode, `errno` is set to `EINVAL`. See the Remarks section for valid modes.
93
+
94
+
For information about these and other error codes, see [_doserrno, errno, _sys_errlist, and _sys_nerr](../../c-runtime-library/errno-doserrno-sys-errlist-and-sys-nerr.md).
95
+
96
+
## Remarks
97
+
The `_popen` function creates a pipe and asynchronously executes a spawned copy of the command processor with the specified string *command*. The character string *mode* specifies the type of access requested, as follows.
98
+
99
+
**"r"**
100
+
The calling process can read the spawned command's standard output using the returned stream.
101
+
102
+
**"w"**
103
+
The calling process can write to the spawned command's standard input using the returned stream.
104
+
105
+
**"b"**
106
+
Open in binary mode.
107
+
108
+
**"t"**
109
+
Open in text mode.
110
+
111
111
> [!NOTE]
112
-
> If used in a Windows program, the `_popen` function returns an invalid file pointer that causes the program to stop responding indefinitely. `_popen` works properly in a console application. To create a Windows application that redirects input and output, see [Creating a Child Process with Redirected Input and Output](http://msdn.microsoft.com/library/windows/desktop/ms682499) in the Windows SDK.
113
-
114
-
`_wpopen` is a wide-character version of `_popen`; the *path* argument to `_wpopen` is a wide-character string. `_wpopen` and `_popen` behave identically otherwise.
115
-
116
-
### Generic-Text Routine Mappings
117
-
118
-
|Tchar.h routine|_UNICODE and _MBCS not defined|_MBCS defined|_UNICODE defined|
> If used in a Windows program, the `_popen` function returns an invalid file pointer that causes the program to stop responding indefinitely. `_popen` works properly in a console application. To create a Windows application that redirects input and output, see [Creating a Child Process with Redirected Input and Output](http://msdn.microsoft.com/library/windows/desktop/ms682499) in the Windows SDK.
113
+
114
+
`_wpopen` is a wide-character version of `_popen`; the *path* argument to `_wpopen` is a wide-character string. `_wpopen` and `_popen` behave identically otherwise.
115
+
116
+
### Generic-Text Routine Mappings
117
+
118
+
|Tchar.h routine|_UNICODE and _MBCS not defined|_MBCS defined|_UNICODE defined|
0 commit comments