#include <wchar.h>
|
FILE *
wpopen (const wchar_t* command, const wchar_t* type ); |
The command argument is a pointer to a null-terminated wide character string containing a shell command line. This command is passed to /bin/sh using the -c flag; interpretation, if any, is performed by the shell.
The return value from wpopen is a normal standard I/O stream in all respects save that it must be closed with pclose rather than fclose. Writing to such a stream writes to the standard input of the command; the command’s standard output is the same as that of the process that called wpopen, unless this is altered by the command itself. Conversely, reading from a "wpopened" stream reads the command’s standard output, and the command’s standard input is the same as that of the process that called wpopen.
Note that output wpopen streams are fully buffered by default.
Failure to execute the shell is indistinguishable from the shell’s failure to execute command, or an immediate exit of the command. The only hint is an exit status of 127.
The wpopen function always calls sh, never calls csh.
© 2005-2007 Nokia |