https://github.com/akkartik/mu/blob/master/real-files.mu

     1 # example program: read a character from one file and write it to another
     2 # BEWARE: this will modify your file system
     3 # before running it, put a character into /tmp/mu-x
     4 # after running it, check /tmp/mu-y
     5
     6 def main [
     7   local-scope
     8   f:num/file <- $open-file-for-reading [/tmp/mu-x]
     9   $print [file to read from: ], f, 10/newline
    10   c:char, eof?:bool <- $read-from-file f
    11   $print [copying ], c, 10/newline
    12   f <- $close-file f
    13   $print [file after closing: ], f, 10/newline
    14   f <- $open-file-for-writing [/tmp/mu-y]
    15   $print [file to write to: ], f, 10/newline
    16   $write-to-file f, c
    17   f <- $close-file f
    18 ]