[rfc] sed option `-i' (edit in place)

Mike Frysinger vapier at gentoo.org
Fri Sep 14 21:50:12 UTC 2007


On Sunday 26 August 2007, Cristian Ionescu-Idbohrn wrote:
> On Sun, 26 Aug 2007, Denys Vlasenko wrote:
> > I think that sed creates new file, fills it and and then renames
> > new file into old file so fast that first metadata update doesn't
> > even have time to hit the disk storage before it's all done.
>
> I believe that may be the case with most fs, but not jffs2.  But don't
> take my word for it.

jffs2 appends changes to erased pages, so there shouldnt be any overhead of 
erasing the sectors the old file was taking ... it'll get garbage collected 
like all other old files at some point

overall though, i'd have to agree with Denys about making a dynamic flag 
bloating things ... but it does suck about having to do this on flash 
filesystems

perhaps you should post a patch that makes a config option that forces all 
inline seds to take a predefined path to use ...
[*] Use a system path for temp files
      /tmp/
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 827 bytes
Desc: This is a digitally signed message part.
Url : http://lists.busybox.net/pipermail/busybox/attachments/20070914/d0db6ce6/attachment-0002.pgp 


More information about the busybox mailing list