0

How would I wrap a function that accepts an argument of type FILE using FFI in Ruby?

int fprintf ( FILE * stream, const char * format, ... );
RyanScottLewis
  • 13,396
  • 16
  • 56
  • 84

1 Answers1

2

It's not type FILE, but FILE *. Just another :pointer like any other.

If you need to build a struct to examine the contents of the memory pointed to, you need to find the definition of FILE in your system's stdio.h and reproduce it as an FFI struct.

dbenhur
  • 20,008
  • 4
  • 48
  • 45