Contents

Atachment
Attachment '1'
?

Shortcut

PrevPrev Article

NextNext Article

Larger Font Smaller Font Up Down Go comment Print
?

Shortcut

PrevPrev Article

NextNext Article

Larger Font Smaller Font Up Down Go comment Print

다른 프로세스 실행결과 가져오기 (popen)

#include <stdio.h>

int main()
{
    FILE *fp;
    char line[255];

    fp = popen("ls -la", "r");

    while ( fgets( line, sizeof(line), fp)){
        printf("%s", line);
    }

    pclose(fp);
} 


?