mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-02 03:02:31 +00:00
Fix (#6093)
This commit is contained in:
committed by
Andreas Rumpf
parent
bdb653c415
commit
9427724a71
@@ -411,12 +411,12 @@ when not defined(js):
|
||||
result.writeDataImpl = fsWriteData
|
||||
result.flushImpl = fsFlush
|
||||
|
||||
proc newFileStream*(filename: string, mode: FileMode = fmRead): FileStream =
|
||||
proc newFileStream*(filename: string, mode: FileMode = fmRead, bufSize: int = -1): FileStream =
|
||||
## creates a new stream from the file named `filename` with the mode `mode`.
|
||||
## If the file cannot be opened, nil is returned. See the `system
|
||||
## <system.html>`_ module for a list of available FileMode enums.
|
||||
var f: File
|
||||
if open(f, filename, mode): result = newFileStream(f)
|
||||
if open(f, filename, mode, bufSize): result = newFileStream(f)
|
||||
|
||||
|
||||
when true:
|
||||
|
||||
Reference in New Issue
Block a user