From: ts Date: 2003-11-07T00:41:10+09:00 Subject: Re: Using blocks in C (with File.open) >>>>> "J" == Jim Freeze writes: J> Can someone provide sample code of how use File.open and J> blocks in C? static VALUE do_work_here(file) VALUE file; { /* do work here */ return Qnil; } J> static VALUE J> each(self, filename) J> VALUE self, filename; J> { J> VALUE f = rb_file_open(filename, rb_str_new2("r")); return rb_ensure(do_work_here, f, rb_io_close, f); J> } Guy Decoux