Re: File perforation.
From: Dave Kleikamp <hidden>
Date: 2003-01-08 22:45:10
On Wednesday 08 January 2003 16:06, David Woodhouse wrote:
I've been resisting these requests because I really don't want to do it with an ioctl on the file. Only if we can have a generic sys_perforate() would I really want to do it.
I have heard requests for the same thing. I would not be opposed to the new system call.
Apparently it's hard to implement on block-based file systems. I don't really care about that though -- just falling back to writing zeroes to the offending range (or indeed returning -EINVAL) would be perfectly sufficient until/unless it gets implemented for other file systems. All I want is an interface that doesn't make me feel dirty :)
I don't think that it would be terribly hard to implement for block-based fs's. It's basically a more general form of truncate. Of course, I'm not saying it would be trivial. Experience says that anything dealing with truncate is full of gotchas and corner cases.
Comments?
-- David Kleikamp IBM Linux Technology Center