C (33/304)

From:Paul Hill
Date:05 Aug 2000 at 14:02:59
Subject:Re: (unknown)

On 04-Aug-00 11:47:26, Bart King wrote:
>Emanuele Cesaroni <emacesa@tin.it> wrote:

>> I have written a shared library, and in some functions of its i call
>> printf().... well when in the main program i open the lib and i call one

>Quite simply, printf() uses stdout and in a shared library, stdin, stdout
>and stderr are all NULL and not allowed.

>If you want to use printf() in a shared library (and you must have a really
>good reason to do so...) openfh=Open("CON:////", MODE_NEWFILE) a console
>yourself, and use fprintf(openfh, "test");...

I thought shared libraries can't do file IO directly? If I understand
correctly you have to spawn a process to do the IO for you. I could be
wrong though (perhaps this was in versions <= 1.3).

If anyone knows the answer I'd love to know - a shared library I'm
programming at the moment needs to read some config files.



Paul