diff options
author | Araq <rumpf_a@web.de> | 2017-04-08 18:19:01 +0200 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2017-04-08 18:19:01 +0200 |
commit | 6eb74c72811a9aba497417df12a9ad031e735b02 (patch) | |
tree | aa032568eca0f367904b9e1da900026f490adb5a | |
parent | 27ede215041fb5269670fef98bb655c15a2724a8 (diff) | |
download | Nim-6eb74c72811a9aba497417df12a9ad031e735b02.tar.gz |
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
-rw-r--r-- | lib/system.nim | 3 | ||||
-rw-r--r-- | lib/system/sysio.nim | 7 |
2 files changed, 0 insertions, 10 deletions
diff --git a/lib/system.nim b/lib/system.nim index 1bc8eb7e1..82d3bb7f7 100644 --- a/lib/system.nim +++ b/lib/system.nim @@ -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 diff --git a/lib/system/sysio.nim b/lib/system/sysio.nim index b199975a9..7444661e3 100644 --- a/lib/system/sysio.nim +++ b/lib/system/sysio.nim @@ -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): |