RosettaCodeData/Task/Flow-control-structures/Nim/flow-control-structures-2.nim

8 lines
114 B
Nim

var f = open "input.txt"
try:
var s = readLine f
except IOError:
echo "An error occurred!"
finally:
close f