severity 373282 wishlist thanks Lars Wirzenius skrev:
Attached is a patch against moreutils to add a -p/--preserve option to sponge that prevents it from modifying the output if the input is identical. This means that something like this: generate-web-page | sponge -p > ~/public_html/index.html no longer results in the output file looking modified to web browsers. To implement this, I am afraid I felt it necessary to change a bunch of other things, too. The code no longer keeps the entire input file in memory, instead it uses a temporary file. I also added option parsing with getopt_long.
I'd probably just stat the output file, and if it's the same size as the input, mmap and memcmp it. If the comparison fails, memcpy, else return.
The getopt stuff is fine with me, at least. - tfheen -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]