First way is correct, except conversion from cstring to string should be made 
with $. 
    
    
    proc read_csv(fpx: cstring): void {.exportc.} =
        let fp = $fpx
        var s = newFileStream(fp, fmRead)
        if s == nil:
            echo "file not found"
            return
    

Reply via email to