Advertisement
Guest User

Untitled

a guest
Jan 13th, 2020
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Nim 0.46 KB | None | 0 0
  1. # ponieważ fseeko nie przyjmuje - przynajmniej w NetBSD - negatywnych offsetów
  2. # a setFilePos używa fseeko: https://github.com/nim-lang/Nim/blob/version-1-0/lib/system/io.nim#L571
  3.  
  4. import streams
  5.  
  6. proc c_lseek(f: FileHandle, offset: int64, whence: cint): cint {.
  7.     importc: "lseek", header: "<unistd.h>", tags: [].}
  8.  
  9. var offset: int64 = -2125381424
  10. var file = open("/dev/kmem")
  11. var fh   = getFileHandle(file)
  12. discard c_lseek(fh, offset, 0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement