[lug] CreateFile problem

Sean Reifschneider jafo at tummy.com
Tue Apr 10 00:06:43 MDT 2001


On Mon, Apr 09, 2001 at 11:01:30PM -0700, mohan kumar wrote:
>im trying to create a file of predefined size. In
>windows i was able to do it with CreateFile. Is it
>possible to do the same in linux?

Use the "dd" command.  For example, to create a file of size 100000 bytes
as /tmp/foo with all bytes initially set to zero:

   dd if=/dev/zero of=/tmp/foo bs=1000 count=100

That copies 100 blocks, each of size 1000 bytes from /dev/zero (the device
which always returns zero) to the file /tmp/foo.

Sean
-- 
 The important thing is not to stop questioning. Curiosity has its own
 reason for existing.  -- Albert Einstein
Sean Reifschneider, Inimitably Superfluous <jafo at tummy.com>
tummy.com - Linux Consulting since 1995. Qmail, KRUD, Firewalls, Python



More information about the LUG mailing list