| delorie.com/archives/browse.cgi | search | 
| Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm | 
| List-Subscribe: | <mailto:cygwin-subscribe AT cygwin DOT com> | 
| List-Archive: | <http://sources.redhat.com/ml/cygwin/> | 
| List-Post: | <mailto:cygwin AT cygwin DOT com> | 
| List-Help: | <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs> | 
| Sender: | cygwin-owner AT cygwin DOT com | 
| Mail-Followup-To: | cygwin AT cygwin DOT com | 
| Delivered-To: | mailing list cygwin AT cygwin DOT com | 
| Message-ID: | <3F72D020.86B6ACAE@iee.org> | 
| Date: | Thu, 25 Sep 2003 12:23:12 +0100 | 
| From: | Don Sharp <dwsharp AT iee DOT org> | 
| X-Accept-Language: | en | 
| MIME-Version: | 1.0 | 
| To: | gnuwin32 <cygwin AT cygwin DOT com> | 
| Subject: | Re: cp /dev/zero filename creates large files | 
| References: | <3F74B306 AT epostleser DOT online DOT no> | 
| X-OriginalArrivalTime: | 25 Sep 2003 11:24:05.0493 (UTC) FILETIME=[877BB250:01C38357] | 
Thanks to everyone that replied pointing out that it was /dev/null that
I needed NOT /dev/zero.
Thanks again
Don Sharp
"Peter J. Acklam" wrote:
> 
> Don Sharp <dwsharp AT iee DOT org> wrote:
> 
> >I carried out the following sequence of commands
> >
> >$ for i in `cat /tmp/d`; do if [ -f $i.idx ]; then ls -l ${i}*; fi; done
> >-rw-r--r--    1 don      None            0 Jun 17  1998 dtaq
> >-rw-r--r--    1 don      None         3072 Jun 17  1998 dtaq.idx
> >$ cp /dev/zero dtaq.idx
> >
> >The cp appeared to be hanging and the disc was rattling away, so in
> >another window I typed in
> >
> >$ ls -l dtaq*
> >-rw-r--r--    1 don      None            0 Jun 17  1998 dtaq
> >-rw-r--r--    1 don      None     65307648 Jun 17  1998 dtaq.idx
> >
> >and you can see that the reported size of the target of the 'cp
> >/dev/zero' has grown to a considerable size in a short time.
> >
> >Can anyone else reproduce this?
> 
> Hopefull, everyone can reproduce this.  I think you are mixing
> /dev/zero with /dev/null.  /dev/zero will always return a buffer
> full of zeros (that is NULs, not the digit or letter zero).
> /dev/zero has infinite length, so copying from it with "cp" to
> a regular file will always cause you do run out of disk space.
> 
> Peter
> 
> --
> Peter J. Acklam - pjacklam AT online DOT no - http://home.online.no/~pjacklam
--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/
| webmaster | delorie software privacy | 
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |