remove default argument for readLines (#12807) [backport]
This commit is contained in:
parent
002d50f1f0
commit
c949b81efd
3 changed files with 5 additions and 5 deletions
|
|
@ -696,10 +696,10 @@ 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] =
|
||||
## read `n` lines from the file named `filename`. Raises an IO exception
|
||||
proc staticReadLines*(filename: string, n: Natural): seq[TaintedString] =
|
||||
## Compile time 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``.
|
||||
## A line of text may be delimited by ``LF`` or ``CRLF``.
|
||||
## The newline character(s) are not part of the returned strings.
|
||||
var f: File
|
||||
if open(f, filename):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue