Timeline for Why was `cp` designed to silently overwrite existing files?
Current License: CC BY-SA 4.0
21 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Oct 24, 2018 at 21:55 | comment | added | tchrist | What do you mean we can't get a proper answer? Just ask Ken, he knows everything. | |
| Oct 24, 2018 at 17:38 | comment | added | doneal24 |
Even better is cat first.html second.html > first.html will give result in first.html being overwritten with the contents of second.html only. The original contents are lost for all time.
|
|
| Oct 24, 2018 at 17:33 | history | edited | sourcejedi | CC BY-SA 4.0 |
deleted 194 characters in body
|
| Oct 24, 2018 at 16:43 | history | edited | sourcejedi | CC BY-SA 4.0 |
added 38 characters in body
|
| Oct 24, 2018 at 16:34 | history | edited | sourcejedi | CC BY-SA 4.0 |
deleted 5 characters in body
|
| Oct 24, 2018 at 16:27 | history | edited | sourcejedi | CC BY-SA 4.0 |
deleted 3 characters in body
|
| Oct 24, 2018 at 16:23 | comment | added | sourcejedi | @riderdragon Programs written in the C language can often fail in very surprising ways, because C trusts the programmer. But programmers are just not that reliable. We have to write very advanced tools, like valgrind, which are needed to try and find the mistakes that programmers make. I think it is important to have programming languages like Rust or Python or C# that try to enforce "memory safety" without trusting the programmer. (The C language was created by one of the authors of UNIX, in order to write UNIX in a portable language). | |
| Oct 24, 2018 at 16:23 | comment | added | sourcejedi | @riderdragon I edited my answer to put my opinion in bold text. "Trust the programmer" is a good description. It was probably an important reason for this design. I did not like to write it: I would also want to write that "trust the programmer" can be bad. | |
| Oct 24, 2018 at 13:17 | history | edited | sourcejedi | CC BY-SA 4.0 |
added 694 characters in body
|
| Oct 24, 2018 at 13:09 | history | edited | sourcejedi | CC BY-SA 4.0 |
added 694 characters in body
|
| Oct 24, 2018 at 13:03 | history | edited | sourcejedi | CC BY-SA 4.0 |
added 694 characters in body
|
| Oct 24, 2018 at 12:46 | history | edited | sourcejedi | CC BY-SA 4.0 |
added 694 characters in body
|
| Oct 24, 2018 at 11:42 | history | edited | sourcejedi | CC BY-SA 4.0 |
added 2 characters in body
|
| Oct 24, 2018 at 11:36 | history | edited | sourcejedi | CC BY-SA 4.0 |
added 2 characters in body
|
| Oct 24, 2018 at 11:35 | comment | added | Kusalananda♦ | @sourcejedi No worries. The word "issue" may be less contentious than "problem". | |
| Oct 24, 2018 at 11:34 | history | edited | sourcejedi | CC BY-SA 4.0 |
added 2 characters in body
|
| Oct 24, 2018 at 11:29 | comment | added | sourcejedi | @Kusalananda I am more interested in trying to keep my answer simple to read - which is something I struggle with! - than not offending people who love Unix :-). I particularly do not want to add too many qualifiers, or use too many different words at once, when the English in the question is not perfect :-). | |
| Oct 24, 2018 at 11:27 | comment | added | sourcejedi | @Kusalananda data loss is a problem. I personally am interested in reducing the risk that I lose data. There are various approaches to this. Saying that it is a problem does not mean the alternatives do not also have problems. | |
| Oct 24, 2018 at 11:17 | comment | added | Wizard | wow, thank you. complement the guideline: 1) Write programs that do one thing and do it well. 2) Trust the programmer. | |
| Oct 24, 2018 at 11:17 | comment | added | Kusalananda♦ |
Why is overwriting the target with cp a "problem"? Having it interactively ask for permission, or fail may be as big a "problem" as that.
|
|
| Oct 24, 2018 at 11:08 | history | answered | sourcejedi | CC BY-SA 4.0 |