Re: [linux-audio-dev] info point on linux hdr

New Message Reply About this list Date view Thread view Subject view Author view Other groups

Subject: Re: [linux-audio-dev] info point on linux hdr
From: Jussi Laako (jussi_AT_jlaako.pp.fi)
Date: Fri Apr 21 2000 - 15:59:16 EEST


Paul Barton-Davis wrote:
>
> ftruncate does *not* allocate disk blocks. it cannot be used this
> way. all it does it to set the length of the file. the disk blocks are
> not allocated until a write to them occurs.

Would this be faster than writing every byte of file at preallocation time?

ftruncate(desired file size)
for (fileposition < file size; fileposition += blocksize)
        lseek(fileposition)
        write(something, sizeof(dword))

Block size here means bytes per inode.

This tries to do same with files as memory management do when committing
memory pages. Just touching every "page" would be enough to do the
allocation? I think preallocating large files by writing every byte of file
is waste of bandwidth..

 - Jussi Laako

-- 
PGP key fingerprint: 161D 6FED 6A92 39E2 EB5B  39DD A4DE 63EB C216 1E4B
Available at: ldap://certserver.pgp.com, http://keys.pgp.com:11371


New Message Reply About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b28 : Fri Apr 21 2000 - 16:25:39 EEST