[OT] C programming question: reopen stdin

Tobias Rehbein tobias.rehbein at web.de
Tue Apr 14 18:13:28 UTC 2009


Hi all.

I'm having a little trouble solving a specific problem in C. I want to write a
filter which reads data from stdin. After reading the user should be able to
interact with the program via stdin. This means I have to reopen stdin but I
don't know how to do this. I tried to solve this using dup() and dup2() but
without success.

You can have a look at my first experiment here:

        http://gist.github.com/95320

I guess the code and the contained comments show what I'm trying to achieve.
Although this is off-topic on this list I hope someone with more knowledge in C
may steer me into the right direction.

Sorry for the noise and thanks for reading.

Regards

Tobias

-- 
Tobias Rehbein

PGP key:         4F2AE314
    server:      keys.gnupg.net
    fingerprint: ECDA F300 1B6E 9B87 8524  8663 E8B6 3138 4F2A E314


More information about the freebsd-questions mailing list