LinuxProgrammer
Programmer
I am trying to use the
call to obtain data. For those that don't know _popen(), it's similar to fopen()'ing a file, but it opens a console application. (For example,
would allow me to read the results of the dir command.)
In my application, if I include the linker flag "
" to make my application (the one using _popen()) a console app, _popen() works fine. However, my application itself is not a console application and I don't wish to have an empty dos window showing while it runs. To clear this window I link with "
" instead. However, for a reason unknown to me, this breaks _popen() -- _popen() consistantly returns a NULL file pointer.
Any idea on how to either make _popen() work correctly in a windows subsystem, or hide the dos window in a console subsystem?
Thanks for any suggestions...
Code:
_popen()
Code:
FILE *f = _popen("dir", "r");
In my application, if I include the linker flag "
Code:
/subsystem:console
Code:
/subsystem:windows
Any idea on how to either make _popen() work correctly in a windows subsystem, or hide the dos window in a console subsystem?
Thanks for any suggestions...