code-examples/current/samples/julia/io.jl

12 lines
156 B
Julia

lines = try
open("/etc/passwd", "r") do f
readlines(f)
end
catch
@warn "File not found"
end
for line in lines
print("Line " * line * "\n")
end