Article View: news.software.readers
Article #15818Re: how do I get it?
From: Greg Berigan
Date: Tue, 07 Mar 1995 03:47
Date: Tue, 07 Mar 1995 03:47
83 lines
3338 bytes
3338 bytes
In news.software.readers, pmclean@virgo.drao.nrc.ca (Philippe McLean) writes:
>gberigan@cse.unl.edu (Greg Berigan) writes:
>>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.
>Really? /dev/zero doesn't return end of file when you read from it.
Exactly. /dev/zero is by design a file of infinite length. On
/dev/zero you can read forever.
>What is /dev/zero?
From the IRIX 5.3 manpages for zero and null:
|ZERO(7) ZERO(7)
|
|
|
|NAME
| zero - source of zeroes
|
|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.
|
|FILES
| /dev/zero
|
|SEE ALSO
| fork(2), mmap(2)
|
| Page 1
That leaves no doubt that /dev/zero is designed for reading.
|NULL(7) NULL(7)
|
|
|
|NAME
| null - the null file
|
|DESCRIPTION
| Data written on the null special file, /dev/null, is discarded.
|
| Reads from a null special file always return 0 bytes.
|
|FILES
| /dev/null
|
| Page 1
A little ambiguous in whether "0 bytes" means null bytes or no bytes.
Like how a dictionary lists the most common and/or preferred spelling
first when listing various spellings for a word, so does this man page
list the primary purpose of our null device.
[Manpages copyright 1987-1994 Silicon Graphics, Inc., All Rights
Reserved. IRIX is a trademark of Silicon Graphics, Inc. ]
--
----' gberigan@cse.unl.edu (Greg Berigan)
------,
,-|-, "Some say he's the devil himself." "I heard he was _
----' '-' a giant chicken!" -- Highlander Boo: The Chickening d b CC
Technical Details
Message-ID:
<3jgkvl$h00@crcnis3.unl.edu>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!bga.com!news.sprintlink.net!howland.reston.ans.net!gatech!newsfeed.pitt.edu!uunet!in1.uu.net!sparky!nlcnews.nlc.state.ne.us!crcnis3.unl.edu!cse!gberiganReferences:
<3iv8uv$9vi@usenet.srv.cis.pitt.edu> <D4q3t5.B1x@info.uucp> <PMCLEAN.95Mar6110448@virgo.drao.nrc.ca>Show Full Headers
Complete Article Headers
Message-ID: <3jgkvl$h00@crcnis3.unl.edu> Subject: Re: how do I get it? Date: Tue, 07 Mar 1995 03:47:01 +0000 From: gberigan@cse.unl.edu (Greg Berigan) References: <3iv8uv$9vi@usenet.srv.cis.pitt.edu> <D4q3t5.B1x@info.uucp> <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!bga.com!news.sprintlink.net!howland.reston.ans.net!gatech!newsfeed.pitt.edu!uunet!in1.uu.net!sparky!nlcnews.nlc.state.ne.us!crcnis3.unl.edu!cse!gberigan Newsgroups: alt.sources.d,comp.lang.perl,comp.lang.tcl,news.misc,news.software.readers,alt.folklore.computers Organization: University of Nebraska--Lincoln Lines: 82 NNTP-Posting-Host: cse.unl.edu X-Newsreader: TIN [version 1.2 PL2] Originator: gberigan@cse.unl.edu