Skip to main content
6 of 6
added 484 characters in body
sergiol
  • 4.2k
  • 1
  • 17
  • 37

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!


# [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!


# [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!

sergiol
  • 4.2k
  • 1
  • 17
  • 37