How can I detect USB flash disc with programming in C?
Hi,
I try to write a C program that can detect whether usb flash disc is enable as a non-root user. Consequently, it will copy some files from the hard disc to the USB flash. I tried this code in C: Code:
system("mount /dev/sda1 /mnt/usb"); Code:
mount: Only root can do this. It failed until I log in as root. In order to allow all users to mount, I inserted this code in fstab: /dev/sda1 /mnt/usb vfat noauto,users,rw,umask=0 0 0 It did not work,it gave same result. I would be happy if anyone can solve my problem or give an idea. Thanks |
You should use either:
Code:
mount /dev/sda1 or Also remove that "umask=0" from /etc/fstab |
Quote:
Quote:
|
All times are GMT -5. The time now is 05:24 PM. |