Re: [dev] [sbase] sponge v2

From: Calvin Morrison <mutantturkey_AT_gmail.com>
Date: Wed, 3 Jul 2013 09:07:12 -0400

On 2 July 2013 20:41, Galos, David <galosd83_AT_students.rowan.edu> wrote:
>> and also depends on having a non-read only filesystem
>> to write too.
> You understand that in order to change the target file, the
> filesystem needs to be writable, right?

What if I had extremely limited filespace though, or only write
permissions to that file?


>> > It's reasonably fast
>> I want faster.
> It's so fast that you never even realized that the moreutils
> version uses a tempfile! Have you complained to GNU
> about `sed -i` using a tempfile?

Just because GNU's coreutils do it, does not mean we have to.

>> It wastes read/writes on my hard drive
> If you don't want the extra writes, mount /tmp as a tmpfs.

I mean I already have that done...

>> Maybe a better solution could be using mmap.
> Perhaps. I still wouldn't know how much to map, so I'd need
> mremap, and from the manpage:
> This call is Linux-specific, and should not be used
> in programs intended to be portable.
> If you write a portable patch making use of mmap, I'll
> definitely consider applying it.
>
> Fundamentally, sbase is about simplicity. The current version
> works well in every circumstance, on platforms as odd as
> lunix, and is absolutely trivial to understand.

is it about simplicity or sucking less? I think writing ot a file,
without the user manually specifying to do so, is a very sucky, if not
totally pointless thing to do. this sbase.c could be rewritten into a
shell script and achieve the same purpose, or the user could easily do
that same thing in a few commands.

I don't really get the benefit of using sponge if it's just writing to
a temporary file.
Received on Wed Jul 03 2013 - 15:07:12 CEST

This archive was generated by hypermail 2.3.0 : Wed Jul 03 2013 - 15:12:06 CEST