Форум С++

 

Ответить на сообщение

Вернуться к теме

Вы отвечаете на сообщение:

Автор: exp   (29.11.2008 в 23:24)
#include <stdio.h>
#include <stdlib.h>
#include <conio.h>

int main()
{
    char    buffer[128];
    FILE    *dsk;

    /* Run CHKDSK so that it writes its output to a pipe. Open pipe
     * with read text attribute so that we can read it like a text file.
     */


    if (( dsk = _popen"dir * | sort | more""rt" )) == NULL )
        exit(1);

    /* Read pipe until end of file. End of file indicates that CHKDSK
     * closed its standard out (probably meaning that it terminated).
     */

    while( !feof( dsk ) )
    {
        fgets( buffer, 128, dsk );
        printf( buffer );
    }

    /* Close pipe and print return value of CHKDSK. */
    printf"\nChild returned %d\n"_pclose( dsk ) );
    return 0;
}


Незнаю можно-ли как-нибудь приделать такое, и не пойму нити-ли это или потоки


Ваше имя:

Пароль:

Цитировать

Используйте тэги для выделения текста:
Код: [code][/code]
Жирный: [b][/b]
Наклонный: [i][/i]
URL: [url][/url]

Сообщение:

Прикрепить: