getFileSize and setFileSize procedures for File and AsyncFile
Platform independent procedure to set a file length. Useful when replacing file content.
This commit is contained in:
parent
4ba6f9808e
commit
bc5c2d8414
4 changed files with 34 additions and 5 deletions
|
|
@ -2895,6 +2895,9 @@ 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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue