From: Tadeusz Bochan Date: 2011-02-24T10:41:15+09:00 Subject: Re: Console output formatting The 'dl' package is certainly one of the most useful Ruby libs out there and avery clever piece of work. It's a shame it hasn't been documented/supported very well. The following works on 1.8.6 and I believe it doesn't in 1.9. No doubt some gurus will be able to clarify. require 'dl' clib = DL.dlopen("/usr/lib/libc.sl") strlen=clib['strlen',"IS"] message = "Hello\n" p strlen[message].first => 6 The above is calling strlen which has simple parameters, an 'I'nteger return, and a 'S'tring by reference. (It's too late in the night to do scanf, and the Standard library already does scanf) You can use this for any C routine, as long as you get the parameter prototype string setup correctly. -- Posted via http://www.ruby-forum.com/.