implemented readAll()
This commit is contained in:
parent
4f08946f64
commit
5ede29cd05
4 changed files with 77 additions and 22 deletions
|
|
@ -1675,10 +1675,13 @@ when not defined(EcmaScript) and not defined(NimrodVM):
|
|||
proc FlushFile*(f: TFile) {.importc: "fflush", noDecl.}
|
||||
## Flushes `f`'s buffer.
|
||||
|
||||
proc readAll*(file: TFile): TaintedString
|
||||
## Reads all data from the stream `file`. Raises an IO exception
|
||||
## in case of an Error
|
||||
|
||||
proc readFile*(filename: string): TaintedString
|
||||
## Opens a file named `filename` for reading. Then reads the
|
||||
## file's content completely into a string and
|
||||
## closes the file afterwards. Returns the string.
|
||||
## Opens a file named `filename` for reading. Then calls readAll
|
||||
## and closes the file afterwards. Returns the string.
|
||||
## Raises an IO exception in case of an error.
|
||||
|
||||
proc writeFile*(filename, content: string)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue