From: "Kent S." Date: 2004-03-30T04:22:48+09:00 Subject: Re: Ruby/DL and output char* parameter Check out this: http://blade.nagaokaut.ac.jp/cgi-bin/vframe.rb/ruby/ruby-talk/94741? 94522-95545 Cheers, Kent. On Mar 29, 2004, at 2:02 PM, Aredridel wrote: > I'm trying to wrap the xattr system calls with Ruby/DL (mostly to learn > Ruby/DL, but I do need to be able to read xattrs eventually) > > My code looks like so: > > require 'dl' > require 'dl/import' > > module Xattr > extend DL::Importable > dlload "libattr.so" > extern "int attr_get(const char*, const char *, char *, int *, int)" > end > > i=[1000] > Xattr.attr_get('.', 'user.description', s, i, 0) > puts s > > The problem is, "s" isn't set to the result, which is returned as the > third parameter. Is there a way to get what was returned in this case? > > Ari >