cp /dev/zero filename creates large files

jurgen.defurne@philips.com jurgen.defurne@philips.com
Thu Sep 25 10:08:00 GMT 2003


Don,

The functionality you need is "/dev/null". 

Indeed, the function of /dev/zero is to provide a
file which you can read indefinitely. You should use
it like this :

dd if=/dev/zero of=<whatever> bs=1024 count=number_of_blocks

Regards,

Jurgen










Don Sharp <dwsharp@iee.org>
Sent by: 
cygwin-owner@cygwin.com
09/25/2003 11:25 AM

 
        To:     gnuwin32 <cygwin@cygwin.com>
        cc:     (bcc: Jurgen Defurne/BRG/CE/PHILIPS)
        Subject:        cp /dev/zero filename creates large files
        Classification: 



Hi

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?

Attaching cygcheck.log

Cheers

Don Sharp--
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/

-------------- next part --------------
A non-text attachment was scrubbed...
Name: cygcheck.log
Type: application/octet-stream
Size: 40888 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20030925/46e07e13/attachment.obj>
-------------- next part --------------
--
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/


More information about the Cygwin mailing list