使用popen函數執行shell命令

標準I/O庫提供了兩個函數popen和pclose。 popen將會調用pipe建立一個管道,fork一個子進程,使用exec執行一個shell命令。(popen須要配合pclose使用)               #include <stdio.h>              FILE * popen(const char *cmdstring,const char *type); cmdst
相關文章
相關標籤/搜索