I am looking to programatically mount a USB drive in Linux, so that I can write a text document using fprintf. I am having trouble finding out how to mount the drive. I have bee
man 2 mount
e.g.
#include if (mount("/dev/mmcblk0p1", "/mnt/sd", "vfat", MS_NOATIME, NULL)) { if (errno == EBUSY) { printf("Mountpoint busy"); } else { printf("Mount error: %s", strerror(errno)); } } else { printf("Mount successful"); }