From: Terry Michaels Date: 2010-10-09T16:20:30+09:00 Subject: Getting the size of a block device In Linux at least, one cannot simply get the size of a block device file (e.g., /dev/sda) by using the normal means of requesting the file size. One must use a special command, such as /sbin/blockdev --getsz /dev/sda Likewise, my experimentation shows that File.size('/dev/sda') in Ruby returns a bogus value. How does one get the size of a block device file in Ruby? 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. -- Posted via http://www.ruby-forum.com/.