[Mono-list] Unable to get block device size in UnixStream

Dragony cschmid at rapidshare.com
Thu Jan 31 14:26:54 UTC 2013

Yes, I need the details without mounting it. Right now I am doing this by
reading /sys/class/block/sda2/size, but that feels so... wrong.
I CAN get the size via FileStream.Length, but not with UnixStream.Length.
Since it has been implemented for FileStream, maybe UnixStream has been

>From strace from blockdevice --getsize:
open("/dev/sda2", O_RDONLY)             = 3
ioctl(3, BLKGETSIZE, 0x7fff98da5750)    = 0

Unfortunately mono has no wrapper for ioctl.

View this message in context: http://mono.1490590.n4.nabble.com/Unable-to-get-block-device-size-in-UnixStream-tp4658310p4658374.html
Sent from the Mono - General mailing list archive at Nabble.com.

More information about the Mono-list mailing list