diff --git a/lib/system/io.nim b/lib/system/io.nim index ead8deb24676..4d396486bdd8 100644 --- a/lib/system/io.nim +++ b/lib/system/io.nim @@ -696,7 +696,7 @@ proc writeFile*(filename: string, content: openArray[byte]) {.since: (1, 1).} = else: raise newException(IOError, "cannot open: " & filename) -proc readLines*(filename: string, n = 1.Natural): seq[TaintedString] = +proc readLines*(filename: string, n: Natural): seq[TaintedString] = ## read `n` lines from the file named `filename`. Raises an IO exception ## in case of an error. Raises EOF if file does not contain at least `n` lines. ## Available at compile time. A line of text may be delimited by ``LF`` or ``CRLF``. @@ -713,6 +713,8 @@ proc readLines*(filename: string, n = 1.Natural): seq[TaintedString] = else: sysFatal(IOError, "cannot open: " & filename) +proc readLines*(filename: string): seq[TaintedString] {.deprecated: "use readLines with two arguments".} + iterator lines*(filename: string): TaintedString {.tags: [ReadIOEffect].} = ## Iterates over any line in the file named `filename`.