From: Daniel Berger Date: 2009-08-02T14:10:45+09:00 Subject: ffi, struct pointer question Hi, I've recently been trying to port some C code over to FFI. I'm trying to figure out how to unravel the gr_mem group struct member. Any suggestions? require 'ffi' module Sys class Admin extend FFI::Library class GroupStruct < FFI::Struct layout( :gr_name, :string, :gr_passwd, :string, :gr_gid, :int, :gr_mem, :pointer ) end attach_function :getgrgid, [:int], :pointer def self.get_group(gid) GroupStruct.new(getgrgid(gid)) end end end # How do I unravel the gr_mem struct member? struct = Sys::Admin.get_group(84) p struct[:gr_mem] Regards, Dan