Article 5C2HE Backup data to Pendrive with c program

Backup data to Pendrive with c program

by
Nishanth1829
from LinuxQuestions.org on (#5C2HE)
Hi all,
I am using a GTK C program in my embedded linux device. I need to backup a folder from my internal memory to pendrive when a button is clicked on the UI. While this, the pendrive is getting mounted as /dev/sda1 and I able to copy files to the /dev/sda1 and after this write cycle from my program, the pendrive volume becomes busy and I am unable to eject it. So when I remove and insert the pendrive, it is getting detected as /dev/sdb1. As the mount location is changing dynamically, I am stuck on how to write my files to pendrive from GTK C program. I am using libudev for pendrive insertion and removal detection.

Is my way correct? If not kindly help me with how to copy a folder from internal memory to pendrive without making the volume busy.

Thanks for your time.
Regards,
Nishanthlatest?d=yIl2AUoC8zA latest?i=i-GNUo6BMnU:HiVHa9CqUkE:F7zBnMy latest?i=i-GNUo6BMnU:HiVHa9CqUkE:V_sGLiP latest?d=qj6IDK7rITs latest?i=i-GNUo6BMnU:HiVHa9CqUkE:gIN9vFwi-GNUo6BMnU
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments