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
- segfault using string from c? segmentation_fault
- Re: segfault using string from c? yglukhov
- Re: segfault using string from c? segmentation_fault
- Re: segfault using string from c? segmentation_fault
- Re: segfault using string from c? yglukhov
- Re: segfault using string from c? yglukhov
- Re: segfault using string fro... segmentation_fault
- Re: segfault using string... segmentation_fault
