3 ms·
Probably not. If it's implemented responsibly, it will internally: 1. Write to a temporary file 2. Do the equivalent of mv tmpfile originalfile so it will eit
by einpoklum 5y ago
Probably not. If it's implemented responsibly, it will internally:
1. Write to a temporary file
2. Do the equivalent of mv tmpfile originalfile
so it will either succeed or do nothing
- sedatk 5y ago"Responsibly" is subjective here. I could argue that responsible thing to do is to use as little resources as possible, and in that case, directly overwriting the file would be the "responsible" thing to do.
- einpoklum 5y ago> I could argue that responsible thing to do is to use as little resources as possible No, you couldn't, because a sponge is intentionally using more resources: It soaks up as much want as it can. And the program is intended to soak up all of the output. Otherwise it would be `cat`.
- sedatk 5y agoYour example proves my point: what's responsible is subjective. It's meaningless to talk about doing the "responsible" thing.