First off, not even sure if the code will really work once I fix this, but I'm 
sure I can figure out the rest;
    
    
    proc get_file_data(file: FileStream, offset: int, size: int): seq[char] =
        var test = newSeq[char]()
        file.setPosition()
        
        for i in offset .. (size - 1):
            var x: char
            file.setPosition(i)
            discard file.readData(x.addr, 1)
            result.add(x)
        
        test
    
    
    Run

returns the error 
    
    
    main.nim(32, 9) Error: type mismatch: got <FileStream>
    but expected one of:
    proc setPosition(s: Stream; pos: int)
    
    expression: setPosition(file)
    
    
    Run

I'm not sure what type I'm supposed to be using? I've tried Stream as well. 
Maybe there's a more elegant way to do this as well? Not sure.

Reply via email to