Link to home
Start Free TrialLog in
Avatar of daanen
daanen

asked on

Drives mounting in C

   Hi
I need to access to CDROM from a my software but I do not want to exit to mount it from a command line. How can I mount a drive CDROM, floppy, ZIP, network drive .... from my source code in C ?
Avatar of rbr
rbr

Check
man -S2 mount



include <sys/mount.h>


ret=mount ("/dev/yourdev","/mountpoint","fs",MS_READONLY,"");

printf("%d",ret);

fs is the filesystem ext2, msdos, ...

man -S2 mount
ASKER CERTIFIED SOLUTION
Avatar of rbr
rbr

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial