I am developing a Qt application for Linux (Ubuntu) in which I use a USB drive to back up some content. The application should unmount the target disk after copying the files. I have a udev rule file for connecting USB in a specific place using ENV{mount_options}="relatime,users,umask=0,uid=user,gid=user" , where the user represents my username.
I tried using this with no luck.
const char* usb = "/mnt/mountpoint/usbdrive"; if (!umount(usb)) { qDebug() << "Device unmounted"; } else { qDebug() << "Can't unmount" << strerror(errno);
Can someone help me here? Am I using umount correctly?
Thanks in advance.
source share