eject a usb drive from a program

hi, has anyone done this? in openframeworks, an addon or coding yourself directly? im in a mac, making dj software, id like the user to have the option to eject the drive they put in the mac themselves so im currently researching how exactly to support that.

cheers for any help.