[PATCH] ash: add support for history buffer
Denys Vlasenko
vda.linux at googlemail.com
Sat Jul 23 15:50:32 UTC 2011
On Wednesday 13 July 2011 15:43, Dennis Groenen wrote:
> On 07/13/2011 03:13 PM, Laurent Bercot wrote:
> > Specialized filesystems such as jffs2 or yaffs2 still can, however.
> Good point, but a lot of, for example closed, embedded/mobile devices
> require a lot of hacking around to get something custom (like a
> different fs) running.
> > Why shouldn't it be? Either you want to reduce the number of writes
> > to the filesystem, or you don't. Delayed writing, which is configured
> > at the filesystem layer, accomplishes this for every application without
> > the need for patching. Applications can always fsync() when they need
> > synchronous writes.
> True, but generally those writes from other applications are going to
> happen anyway. E.g. if I save a file in application X, it will need to
> be written out, and be written out completely. For BusyBox's history,
> this isn't the case. I don't see why a file has to be written out after
> each appended line here. Vi doesn't write out a file after each new line
> either, does it?
sh can crash.
sh can be killed by a signal.
sh can be run in parallel from two terminals, and saving at exit creates
unfairness: whoever exits last overwrites the history of other guys.
Nevertheless, I am not firmly against saving only on exit.
Actually, I think that's the option you'd like.
So, (1) it would largely solve your problem
and (2) it would also be welcomed by people who like
more bash-like behavior wrt history saving.
Can you code up a patch which does this?
--
vda
More information about the busybox
mailing list