1 /* We do not modify RSTRING in this file, so RSTRING_MODIFIED is not needed */
2 #if defined(HAVE_RB_IO_T) && \
3 defined(HAVE_TYPE_STRUCT_RFILE) && \
6 static void set_file_path(VALUE io
, VALUE path
)
8 rb_io_t
*fptr
= RFILE(io
)->fptr
;
9 fptr
->pathv
= rb_str_new4(path
);
11 #elif defined(HAVE_TYPE_OPENFILE) && \
12 defined(HAVE_TYPE_STRUCT_RFILE) && \
16 static void set_file_path(VALUE io
, VALUE path
)
18 OpenFile
*fptr
= RFILE(io
)->fptr
;
19 fptr
->path
= ruby_strdup(RSTRING_PTR(path
));
23 static void set_file_path(VALUE io
, VALUE path
)
25 rb_iv_set(io
, "@path", rb_str_new4(path
));