remove system.getFileSize again, breaks windows builds and I don't want more stuff that's a pain to support in a platform independent manner
This commit is contained in:
parent
27ede21504
commit
6eb74c7281
2 changed files with 0 additions and 10 deletions
|
|
@ -52,8 +52,6 @@ proc c_ferror(f: File): cint {.
|
|||
importc: "ferror", header: "<stdio.h>", tags: [].}
|
||||
proc c_setvbuf(f: File, buf: pointer, mode: cint, size: csize): cint {.
|
||||
importc: "setvbuf", header: "<stdio.h>", tags: [].}
|
||||
proc c_ftruncate(f: FileHandle, len: clong): cint {.
|
||||
importc: "ftruncate", header: "<unistd.h>".}
|
||||
|
||||
proc raiseEIO(msg: string) {.noinline, noreturn.} =
|
||||
sysFatal(IOError, msg)
|
||||
|
|
@ -375,11 +373,6 @@ proc getFileSize(f: File): int64 =
|
|||
result = getFilePos(f)
|
||||
setFilePos(f, oldPos)
|
||||
|
||||
proc setFileSize(f: File, size: int64) =
|
||||
## Set a file length.
|
||||
if c_ftruncate(getFileHandle f, size.clong) == -1:
|
||||
raiseEIO("cannot truncate file")
|
||||
|
||||
proc readFile(filename: string): TaintedString =
|
||||
var f: File
|
||||
if open(f, filename):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue