Variable popen calls in C
Posted
by Bushman
on Stack Overflow
See other posts from Stack Overflow
or by Bushman
Published on 2010-04-25T17:57:43Z
Indexed on
2010/04/25
18:03 UTC
Read the original article
Hit count: 280
I'm trying to execute MS-DOS DEL
commands inside a Win32 C program, and I already know that system
and popen
can be used for this. However, the problem is that both require string literals (type const char
) for the commands, and I need something like the DOS equivalent of dir ~ | grep -P '/\d{7,8}\.exe$/' | rm
, which obviously can't use string literals. Is there some other subprocess function in C that allows for char arrays as arguments for process names?
© Stack Overflow or respective owner