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:
Araq
2017-04-08 18:19:01 +02:00
parent 27ede21504
commit 6eb74c7281
2 changed files with 0 additions and 10 deletions

View File

@@ -2895,9 +2895,6 @@ when not defined(JS): #and not defined(nimscript):
proc getFileSize*(f: File): int64 {.tags: [ReadIOEffect], benign.}
## retrieves the file size (in bytes) of `f`.
proc setFileSize*(f: File, size: int64) {.tags: [ReadIOEffect], benign.}
## changes the size of file `f` (in bytes).
proc readBytes*(f: File, a: var openArray[int8|uint8], start, len: Natural): int {.
tags: [ReadIOEffect], benign.}
## reads `len` bytes into the buffer `a` starting at ``a[start]``. Returns

View File

@@ -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):