Why is there no `file:move` (was: Why, [...] maps but array?)

Michael P. empro2@REDACTED
Tue Aug 17 17:32:50 CEST 2021


On Sat, 14 Aug 2021 18:42:40 -0400
"Lloyd R. Prentice" <lloyd@REDACTED> 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.







More information about the erlang-questions mailing list