Re: Why is there no `file:move` (was: Why, [...] maps but array?)
Andrei Dziahel <[email protected]>
| Newsgroups | gmane.comp.lang.erlang.general |
|---|---|
| Message-ID | <CAAnW7azz__zAXtU+Ci9PdXGtQ=wPrfj2-Ss2=H2R+8pWs3kMXQ@mail.gmail.com> |
Try file:rename On Tue, Aug 17, 2021, 17:33 Michael P. <[email protected]> wrote: > 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. > > > > > >