Linux programming "program to format an external storage device?"
Hi,
I am a newbie to programming on linux.
I wanted to write a program to detect and format an external Usb storage device connected to linux.
I need info from a programming point of view:
1. how does linux tell me if a new mass storage usb device is plugged into the system?
2. How do i format the device connected ? I checked man pages and found reference to "mkfs". The only way to make it work through code is by using the system() API. I do not want to use system() API. Is there any other way of doing this ?
Thanks in advance,
- Karbon.
|