From: Daniel Berger Date: 2011-01-06T03:34:36+09:00 Subject: Re: Getting the actual size of a sparse file On Jan 5, 9:58 am, Perry Smith wrote: > I would go find the source for Ubuntu's ls and see what does it do for > the -s option. > > Note that -s is output in blocks. Yeah, looks like ls -s defaults to a block size of 1. Hm, how does this look? class File def self.sparse?(file) stats = File.stat(file) stats.size > stats.blocks * stats.blksize end end