Re: [wmii] adding data to 9p files using wmiir

From: Kris Maglione <maglione.k_AT_gmail.com>
Date: Wed, 18 Mar 2009 19:30:01 -0400

On Thu, Mar 19, 2009 at 12:16:10AM +0100, Martin Kraus wrote:
>Basicaly I'd expect this not to work, since wmiir is reading and at the same
>time overwriting the data. It had worked as far as I've tried. Is it because
>wmiir first reads all the data and then outputs it so that the other wmiir
>write will just overwrite alread read data, or have I been lucky and reading
>from the file was just always quicker then writing to it?
>
>Simply put, can I safely use the above syntax or should I read it into a
>variable and then overwrite it?

Well, you can safely use it as long as you have less than about
8K of colrules. It actually works because wmii truncates those
files to the last byte written on every write, but wmiir doesn't
write anything to the filesystem until it recieves something
from stdin. Since it won't recieve anything until the first
wmiir finishes its read, you're fine as long as the first read
returns the whole file (which it will if it's under 8K).

So, that was more than you asked for. How about this: I'll just
add a -a flag to 'wmiir write'.

-- 
Kris Maglione
When a religion is good, I conceive it will support itself; and when
it does not support itself, and God does not take care to support it
so that its professors are obliged to call for help of the civil
power, 'tis a sign, I apprehend, of its being a bad one.
	--Benjamin Franklin
Received on Wed Mar 18 2009 - 23:30:01 UTC

This archive was generated by hypermail 2.2.0 : Wed Mar 18 2009 - 23:36:06 UTC