From owner-freebsd-hackers Sat Dec 2 6:53:14 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from int80h.org (r40.bfm.org [216.127.220.136]) by hub.freebsd.org (Postfix) with ESMTP id 6E84D37B400 for ; Sat, 2 Dec 2000 06:53:10 -0800 (PST) Received: (from root@localhost) by int80h.org (8.9.2/8.9.2) id IAA00309 for hackers@FreeBSD.org; Sat, 2 Dec 2000 08:51:58 -0600 (CST) (envelope-from adam) Date: Sat, 2 Dec 2000 08:51:27 -0600 From: Charlie & To: hackers@FreeBSD.org Subject: pipe Message-ID: <20001202085127.A301@int80h.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0.1i Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Sorry if this is a dumb question, but after years of DOS programming, I am still discovering the subletiest of Unix: When I create a pipe, do I have to use it for interprocess communication only, or can the same process write to one end and later read from the other? What I am looking for is to use it as a FIFO-style buffer. Instead of allocating and reallocating memory, let the system worry about how much memory the data needs. This is for a two (or more) pass compiler, which reads from stdin and writes to stdout. It does not know how much data it still has coming in, so it has no idea how much memory it needs to store information in, yet after one pass it needs to read it in the same order it was written (FIFO). If this is possible, is there a limit as to how much I can write to the pipe before I start reading it, or is it limitless (within reason, of course)? Cheers, Adam To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message