read random blocks on block device

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I need to write a C program that will accomplish these things:
- read the name of a block device from the command line (e.g. myprog /dev/sda)
- open that block device in raw mode, read only
- read a random block, discard, repeat (infinite loop)

I wonder if there are techniques to do that specific to block devices. In other words, if block devices are somehow different in this regard.

I'm not a professional programmer and my programing experience is mostly with scripting languages, but I can write a simple C program if I have to.

This sounds like a textbook example, but I couldn't find anything on the Web.

--
Florin Andrei

http://florin.myip.org/

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux