C : get drive/partitions list
HI,
I'd like to retrieve drives and partitions in C language. I know I can read /proc/partitions (or mtab), but I'd like to learn the C way to access hardware in Linux. Would you have a link website, book; etc. ? Thanks for your help. |
Wait for more experienced programmers, but I think thats a kernel land thing, not a user land thing. It depends what you mean by "access hardware", but generally you'd want to look into kernel programming in C?
I'm just trying to learn the Linux environment at the moment, generally working in user space. You might want to get started with the Linux Kernel Module Programming Guide that I've seen updated lately on tldp. EDIT: I just looked at the guide a bit more, it might not be the best guide for a single task - like accessing your HDD, but you might still be interested. |
Is this helpful?
http://www.ussg.iu.edu/hypermail/lin...04.2/0345.html First site I found on google with partitions ioctl as the search. |
Thanks, both of you, for your help. I have a good starting point. I'll try and read partitions.c in kernel sources to see how it is done. :)
|
All times are GMT -5. The time now is 03:55 PM. |