Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 2 Dec 2000 08:51:27 -0600
From:      Charlie & <root@int80h.org>
To:        hackers@FreeBSD.org
Subject:   pipe
Message-ID:  <20001202085127.A301@int80h.org>

next in thread | raw e-mail | index | archive | help
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




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