Boston Linux & Unix (BLU) Home | Calendar | Mail Lists | List Archives | Desktop SIG | Hardware Hacking SIG
Wiki | Flickr | PicasaWeb | Video | Maps & Directions | Installfests | Keysignings
Linux Cafe | Meeting Notes | Blog | Linux Links | Bling | About BLU

BLU Discuss list archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: edit a file in place



 On Wed, Aug 6, 2008 at 12:52 PM, Derek Martin <[hidden email]>wrote: 

> A coworker asked me if I could think of any Linux/Unix utility which 
> would allow him to change one line of a file in place (i.e. without 
> creating a temporary file a la sed and overwriting the old version a C 
> program to do it -- you could, for example, mmap the file, move the block 
> after the line to the right place (depending on whether the 
> new line was longer or shorter), write the new line, and truncate the 
> file if necessary.  This, of course, is way too much trouble to make 
> it worthwhile. :) 
> 
> While personally I have no problem using temp files, I did wonder if 
> there wasn't already something which could do this easily...  Anyone 
> have any ideas? 
> 
> -- 
> Derek D. Martin    http://www.pizzashack.org/   GPG Key ID: 0xDFBEAD02 
> -=-=-=-=- 
> This message is posted from an invalid address.  Replying to it will result 
> in 
> undeliverable mail due to spam prevention.  Sorry for the inconvenience. 
> 
> 
> _______________________________________________ 
> Discuss mailing list 
> [hidden email] 
> http://lists.blu.org/mailman/listinfo/discuss
> 
> 


BLU is a member of BostonUserGroups
BLU is a member of BostonUserGroups
We also thank MIT for the use of their facilities.

Valid HTML 4.01! Valid CSS!



Boston Linux & Unix / webmaster@blu.org