in reply to Re: how to give size to a file at the time of creation
in thread how to give size to a file at the time of creation

If your filesystem supports sparse files, you don't need to write it all, one byte will do:

$ rm -f xx ; perl -wE'open$a,">","xx";seek$a,1048575,0;print$a "x"' ; +ls -l xx -rw-rw-rw- 1 merijn users 1048576 May 3 09:59 xx

Enjoy, Have FUN! H.Merijn

Replies are listed 'Best First'.
Re^3: how to give size to a file at the time of creation
by Random_Walk (Prior) on May 03, 2013 at 08:59 UTC

    I tried seek first, but I am on a work XP box and it just gave me a small file. Like you said if your OS supports...

    Cheers,
    R.

    Pereant, qui ante nos nostra dixerunt!