Article View: news.software.readers
Article #15995Re: how do I get it?
From: John Porter
Date: Mon, 13 Mar 1995 17:26
Date: Mon, 13 Mar 1995 17:26
55 lines
2621 bytes
2621 bytes
In article <3jdm0q$e0j@crcnis3.unl.edu>,
Greg Berigan <gberigan@cse.unl.edu> wrote:
>
>The problem is that /dev/null is for output, not input. You use
>/dev/zero for reading. Thus:
>
> cat /dev/zero >/dev/null
>
>A common mistake.
According to the Sun 4.1 man pages:
NULL(4) DEVICES AND NETWORK INTERFACES NULL(4)
FILES
/dev/null
DESCRIPTION
Data written on the null special file is discarded.
Reads from the null special file always return an end-of-
file indication.
And:
ZERO(4S) DEVICES AND NETWORK INTERFACES ZERO(4S)
FILES
/dev/zero
DESCRIPTION
A zero special file is a source of zeroed unnamed memory.
Reads from a zero special file always return a buffer full
of zeroes. The file is of infinite length.
Writes to a zero special file are always successful, but the
data written is ignored.
Mapping a zero special file creates a zero-initialized
unnamed memory object of a length equal to the length of the
mapping and rounded up to the nearest page size as returned
by getpagesize(2). Multiple processes can share such a zero
special file object provided a common ancestor mapped the
object MAP_SHARED.
So, while /dev/zero may do what you say it does, I don't
think that's what it was intended for.
And your assertion that "/dev/null is for output, not input" is false.
john porter
jporter@btg.com
Technical Details
Message-ID:
<3k1v88$3g9@elara.btg.com>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-comp.lang.perl.mbox.zip!nntp.gmd.de!news.rwth-aachen.de!news.rhrz.uni-bonn.de!news.uni-stuttgart.de!rz.uni-karlsruhe.de!news.rz.uni-ulm.de!zib-berlin.de!news.mathworks.com!uunet!in1.uu.net!news.btg.com!not-for-mailReferences:
<3iv8uv$9vi@usenet.srv.cis.pitt.edu> <3javk0$l8k@fcca.fcca.csi.com> <3jdm0q$e0j@crcnis3.unl.edu> <PMCLEAN.95Mar6110448@virgo.drao.nrc.ca>Show Full Headers
Complete Article Headers
Message-ID: <3k1v88$3g9@elara.btg.com> Subject: Re: how do I get it? Date: Mon, 13 Mar 1995 17:26:32 +0000 From: jporter@elara.btg.com (John Porter) References: <3iv8uv$9vi@usenet.srv.cis.pitt.edu> <3javk0$l8k@fcca.fcca.csi.com> <3jdm0q$e0j@crcnis3.unl.edu> <PMCLEAN.95Mar6110448@virgo.drao.nrc.ca> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-comp.lang.perl.mbox.zip!nntp.gmd.de!news.rwth-aachen.de!news.rhrz.uni-bonn.de!news.uni-stuttgart.de!rz.uni-karlsruhe.de!news.rz.uni-ulm.de!zib-berlin.de!news.mathworks.com!uunet!in1.uu.net!news.btg.com!not-for-mail Newsgroups: alt.sources.d,comp.lang.perl,comp.lang.tcl,news.misc,news.software.readers,alt.folklore.computers Organization: BTG, Inc., Vienna, VA, USA Lines: 54 NNTP-Posting-Host: elara.btg.com