# [Tcl], 71 bytes

 file ren i.txt m
 file ren -force o.txt i.txt
 file ren m o.txt
 file de m

[Try it online!][TIO-m974joc6]

[Tcl]: http://tcl.tk/
[TIO-m974joc6]: https://tio.run/##jZDPCsIwDMbveYpQveo76OykIC3owMPYQbYOCpsZW0Xfvrp1/5AdluOXfPl9iU0Ltwmu/BBxNBiKC4dGW8wNxlTpJ5q9/Vh8J1C9bIPbn86O/CwkqhAFiDUFXJ66cQZpQY1utwAMUJpBqYfSH5RmUAVqTQ1QNUEJXG4KjfV4VgmjsMupTnVP7rpTr/SyFzKNpetyMcnvGCgZcRndWpZhPnBc60c2/1@SACxbaMFC3uK@ "Tcl – Try It Online"

---
<s>
# [Tcl], 84 bytes

With renaming allowed, things get shorter:

 file rename i.txt m
 file rename -force o.txt i.txt
 file rename m o.txt
 file delete m

[Try it online!][TIO-m973zvre]

[Tcl]: http://tcl.tk/
[TIO-m973zvre]: https://tio.run/##jZDPCoJAEMbv8xTD1rXeoWwNIXahhA7iQWyEBXVEN@rtzb@0hQfn@M188/tmbJq3G@8qD6FEg35wkdCQxcxgxBWVaPb2bfEVQ/W0DW47XRzlOVCofQwgWFMg1WkYF5Dm3FC/BWCGsgPlCcp/UHagGvSamqH6C2VoM5MT1lQmBU2XFeBqu4zrlCb@MPDTLsbOqD0oJ9tp7RBSKHlHT6tQqvDWg40Y00c1JQ/3mXEMsGzhBQuPlvYD "Tcl – Try It Online"
</s>

---
<s>
# [Tcl], 122 bytes

 set A [read [open i.txt]]
 puts [set i [open i.txt w]] [read [open o.txt]]
 puts [set o [open o.txt w]] $A
 close $i
 close $o

[Try it online!][TIO-jrc5u2pp]

[Tcl]: http://tcl.tk/
[TIO-jrc5u2pp]: https://tio.run/##jY/BCsIwDIbveYpQd/Yd5uykIC3owMPoQWaFwjDDVfTtqx0tzrnDcgrJ/@f745rWr4oDzyuOFkux59Abh1eLNXXmhnbtXg6fGrqH6zH7zNmG74REVaIAsaSAy@0gZ9C01JtwBSBBaQSlCKUJlEZQBWpJJaj6Qgl8oORY3835Mv5PR1Id9tPP9Y@e/vTT0BqzPDFtasgPBib5CQslKy6rY4hnWbw0EwnmLTRjian8Gw "Tcl – Try It Online"
</s>