Why is there no `file:move` (was: Why, [...] maps but array?)
"Michael P." <[email protected]>
| Newsgroups | gmane.comp.lang.erlang.general |
|---|---|
| Message-ID | <20210817173250.5640ff5f@aesop> |
On Sat, 14 Aug 2021 18:42:40 -0400 "Lloyd R. Prentice" <[email protected]> wrote: I cannot assess the perils that may lurk within this: ``` move_file(From, To) -> Content = file:read_file(From), file:write_file(To, Content), file:delete(From). ``` Thus, such is not fit for inclusion in "the library". It may serve some purpose, but its flaws would lead to people desiring, requesting, and possibly demanding some `file:DWIM...`. And relieving such desire is not feasible: deeper look into system => more dread => more work. So each gets to write their own DWYW function or module, be content with it, maybe spread it, suffer from its flaws, develop it, discuss it. And, at some time, possibly, it may be included in "the library", making Erlang a better language. ~Michael -- Reasonable is that which cannot be criticised reasonably anymore.