From: Joel VanderWerf Date: 2010-10-10T02:35:57+09:00 Subject: Re: Getting the size of a block device On 10/09/2010 05:35 AM, Brian Candler wrote: > Terry Michaels wrote: >> Obviously, I could wrap a system call around a Linux utility or read a >> proc file... but I am curious if there is a 'built-in' Ruby method. > > The ioctl is called BLKGETSIZE/BLKGETSIZE64, and a quick grep of the > ruby source code doesn't find it. > > Maybe someone else has published an extension which wraps the API > directly, but you could just use IO.ioctl directly. Does the sys-filesystem gem have something like that? http://rubyforge.org/docman/view.php/610/1562/sys-filesystem.html