SYNOPSIS
#include <stdio.h>
FILE *popen(const char *command, const char *mode);
DESCRIPTION
The
The
The requested mode string specifies the I/O mode:
- If the mode is "r", "rt", or "rb", when the child process is started, its stdout is the writable end of the pipe, and the file descriptor of the returned stream is the readable end of the pipe.
- If the mode is "w", "wt", or "wb", when the child process is started, its stdin is the readable end of the pipe, and the file descriptor of the returned stream is the writable end of the pipe.
- If the mode is anything else, the behavior is undefined.
After
PARAMETERS
- command
-
Points to a null-terminated string consisting of a shell command line.
- mode
-
Points to a null-terminated string consisting of an I/O mode, as described in the DESCRIPTION section.
RETURN VALUES
If successful,
CONFORMANCE
POSIX.1 (1996), with exceptions.
MULTITHREAD SAFETY LEVEL
MT-Safe.
PORTING ISSUES
There is no default shell in the Window environment. Hence the NuTCRACKER Platform
first checks
for SHELL in the environment to determine the shell to use,
and then checks COMSPEC for a fall-back command interpreter.
If neither is set, then
The NuTCRACKER Platform supports text and binary modes for the
pipe. Refer for
You must ensure that any path name arguments you pass to non-NuTCRACKER Platform applications are in Win32 format, as only NuTCRACKER Platform applications recognize the NuTCRACKER Platform format. Refer to Path Names in the Windows Concepts chapter of the PTC MKS Toolkit UNIX to Windows Porting Guide for more information.
AVAILABILITY
PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition
SEE ALSO
- Functions:
_NutForkExeclp() ,fopen() ,pclose() ,pipe() ,system()
PTC MKS Toolkit 10.4 Documentation Build 39.