Extending a file backwards

Rahul Dhesi dhesi at bsu-cs.bsu.edu
Sun May 21 06:20:33 AEST 1989


While we are on the subject (sort of), here is another idea.

I want to be able to say

     lseek (fd, (long) -count, 1);
     write (fd, buf, count);

and have it work even if the file pointer is at the beginning of the
file.  This will not be easy to implement.  It will require the
filesystem to add a block to the beginning of the file (easy), and
remember where within that block the file actually starts (harder).

But it could be very useful.  Many programs (e.g. sendmail) spend a lot
of time manipulating headers in a message without touching the body.
My repl command adds a Replied: header as the first line in each
message to which I reply.  Currently these manipulations involve making
a new copy of the message.
-- 
Rahul Dhesi <dhesi at bsu-cs.bsu.edu>
UUCP:    ...!{iuvax,pur-ee}!bsu-cs!dhesi



More information about the Comp.unix.wizards mailing list