On Mar 26, 2012, at 4:18 PM, Bob Friesenhahn wrote: > On Mon, 26 Mar 2012, Andrew Gabriel wrote: > >> I just played and knocked this up (note the stunning lack of comments, >> missing optarg processing, etc)... >> Give it a list of files to check... > > This is a cool program, but programmers were asking (and answering) this same > question 20+ years ago before there was anything like SEEK_HOLE. > > If file space usage is less than file directory size then it must contain a > hole. Even for compressed files, I am pretty sure that Solaris reports the > uncompressed space usage.
+1 Also, prior to ZFS, you could look at the length of the file (ls -l or stat struct st_size) and compare to the size (ls -ls or stat struct st_blocks). If length > size (unit adjusted, rounded up) then there are holes. In ZFS, this can be more difficult, because the size can be larger than the length (!) due to copies. Also, if you have compression enabled, size can be < length. -- richard -- DTrace Conference, April 3, 2012, http://wiki.smartos.org/display/DOC/dtrace.conf ZFS Performance and Training richard.ell...@richardelling.com +1-760-896-4422
_______________________________________________ zfs-discuss mailing list zfs-discuss@opensolaris.org http://mail.opensolaris.org/mailman/listinfo/zfs-discuss