From owner-freebsd-hackers Sun Dec 27 15:58:41 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id PAA18502 for freebsd-hackers-outgoing; Sun, 27 Dec 1998 15:58:41 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from cserv.oksys.bg (ppp45.bulinfo.net [195.10.36.90]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id PAA18432 for ; Sun, 27 Dec 1998 15:58:14 -0800 (PST) (envelope-from ian@bulinfo.net) Received: from bulinfo.net (cserv.oksys.bg [192.72.180.21]) by cserv.oksys.bg (8.8.8/8.8.8) with ESMTP id BAA04650 for ; Mon, 28 Dec 1998 01:56:51 +0200 (EET) (envelope-from ian@bulinfo.net) Message-ID: <3686C942.B51A4937@bulinfo.net> Date: Mon, 28 Dec 1998 01:56:50 +0200 From: Yani Brankov Organization: ok systems X-Mailer: Mozilla 4.5 [en] (X11; I; FreeBSD 2.2.8-STABLE i386) X-Accept-Language: bg, en MIME-Version: 1.0 To: hackers@FreeBSD.ORG Subject: howto redirect stdin/stdout Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Hi, Maybe it's a stupid question, but I don't have much time to search into the FreeBSD sources for an example. I need to redirect the stdout from a parent process to stdin to its child within a C program. Imagine I would like to start lpr(1) with exec(3) from the C program and send data to stdin of the lpr(1) from the same C prg. I don't know what to do with the file descriptors. If you don't have much time too, just tell me where to find a helpful example. Thanks in advance. --ian To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message