Why is there no `file:move` (was: Why, [...] maps but array?)
Andrei Dziahel
develop7@REDACTED
Wed Aug 18 09:01:34 CEST 2021
Try file:rename
On Tue, Aug 17, 2021, 17:33 Michael P. <empro2@REDACTED> wrote:
> 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.
>
>
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20210818/3198b55c/attachment.htm>
More information about the erlang-questions
mailing list