Oleg Goldshmidt wrote:

Purely from memory, it is POSIX, though I would use STDOUT_FILENO
or fileno(stdout).

OK. I see I wasn't clear about what i was asking.


Here is the question rephrased:

Will I get the exact same stream handle every time I fdopen file dscriptor 1?

For example, does the following *guranteed* to work?

#include <stdio.h>
#include <string.h>

int main(void) {

printf("stdout: %lx\n", stdout);

fclose(stdout);

        if((FILE *)fdopen(1,"w") != stdout)
                printf("1: %s\n", strerror);

return 0;
}

It does work in the specific example, btw.

Gilad.


================================================================= To unsubscribe, send mail to [EMAIL PROTECTED] with the word "unsubscribe" in the message body, e.g., run the command echo unsubscribe | mail [EMAIL PROTECTED]



Reply via email to