mirror of
https://github.com/nim-lang/Nim.git
synced 2026-02-13 06:43:52 +00:00
@@ -130,7 +130,10 @@ else:
|
||||
const
|
||||
BufSize = 4000
|
||||
|
||||
proc close*(f: File) = discard c_fclose(f)
|
||||
proc close*(f: File) =
|
||||
if not f.isNil:
|
||||
discard c_fclose(f)
|
||||
|
||||
proc readChar(f: File): char =
|
||||
let x = c_fgetc(f)
|
||||
if x < 0:
|
||||
|
||||
@@ -103,3 +103,7 @@ block t5349:
|
||||
|
||||
for line in lines("test.txt"):
|
||||
echo line
|
||||
|
||||
block t9456:
|
||||
var f: File
|
||||
f.close()
|
||||
|
||||
Reference in New Issue
Block a user