mfiles.nim 180 B

123456789101112
  1. import mhandles
  2. type
  3. File* = ref object
  4. handle: Handle[FD]
  5. proc close*[T: File](f: T) =
  6. f.handle.close()
  7. proc newFile*(fd: FD): File =
  8. File(handle: initHandle(FD -1))