Skip to content

Commit

Permalink
More debugging - haven't fixed the ioctl problem yet
Browse files Browse the repository at this point in the history
  • Loading branch information
ebolwidt committed Mar 5, 2011
1 parent ea9c39a commit bc5a5fa
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/file/file_patch.rb
Expand Up @@ -4,14 +4,17 @@ class File

# Returns size of file in bytes, or of block device if it is a block device.
def size
if blockdev?
if stat.blockdev?
blockdev_size
else
stat.size
end
end

def blockdev_size
# v = "\0" * 8
v = "01234567"
$stderr.puts(v.length)
ioctl(0x80081272, v)
v.unpack("Q")[0]
end
Expand Down

0 comments on commit bc5a5fa

Please sign in to comment.