Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 16 Apr 2009 21:16:03 +0200
From:      Tobias Rehbein <tobias.rehbein@web.de>
To:        Mel Flynn <mel.flynn+fbsd.questions@mailing.thruhere.net>
Cc:        freebsd-questions@freebsd.org
Subject:   [tobias.rehbein@web.de: Re: [OT] C programming question: reopen stdin]
Message-ID:  <20090416191603.GA9220@sushi.pseudo.local>

next in thread | raw e-mail | index | archive | help

--EeQfGwPcQSOJBaQU
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

s/Good/Could/

--EeQfGwPcQSOJBaQU
Content-Type: message/rfc822
Content-Disposition: inline

Date: Thu, 16 Apr 2009 21:03:52 +0200
From: Tobias Rehbein <tobias.rehbein@web.de>
To: Mel Flynn <mel.flynn+fbsd.questions@mailing.thruhere.net>
Cc: freebsd-questions@freebsd.org
Subject: Re: [OT] C programming question: reopen stdin
Message-ID: <20090416190352.GA5366@sushi.pseudo.local>
Mail-Followup-To: Mel Flynn <mel.flynn+fbsd.questions@mailing.thruhere.net>,
	freebsd-questions@freebsd.org
References: <20090414181300.GA3813@sushi.pseudo.local>
	<200904142107.26678.mel.flynn+fbsd.questions@mailing.thruhere.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <200904142107.26678.mel.flynn+fbsd.questions@mailing.thruhere.net>
User-Agent: Mutt/1.4.2.3i

Am Tue, Apr 14, 2009 at 09:07:26PM +0200 schrieb Mel Flynn:
> On Tuesday 14 April 2009 20:13:00 Tobias Rehbein wrote:
> 
> > 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.
> 
> Just open(2) /dev/tty. If tty is invalid, then you don't have to expect a user 
> either.

Thanks for this hint. I tried to implement an example. Good someone take a look
at it and tell me if I did it right. Well, at least it works...

The code is here:

        http://gist.github.com/95320

To avoid further spamming of the freebsd-questions mailing list: Could someone
point me to a good place to ask C programming questions?

Regards 

        Tobias

--EeQfGwPcQSOJBaQU--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090416191603.GA9220>