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: Paul Barton-Davis (pbd_AT_Op.Net)
Date: Fri Apr 21 2000 - 03:57:07 EEST


>> the simple act of creating 24 5 minute WAV files on ext2, files in
>> which every block has been allocated, takes at least 1 minute, perhaps
>> as much as 2. i create the files by first opening them, then writing a
>> zero byte every blocksize bytes (blocksize comes from stat(2)), except
>> for the WAV header at the beginning.
>
>How about ftruncate(2)? I haven't timed this, but I remember using this with
>memory mapped files as proposed by great book "POSIX.4 Programming for the
>real world" by Bill O. Gallmeister.

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.

there has been some discussion on linux-kernel of the need for the
POSIX function fallocate(). its not clear to me that ulrich drepper
has convinced the necessary parties of the need for it, yet.

--p


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 - 04:29:50 EEST