Are you trying to script this? What is the end goal? If you're trying to make some sort of backup program, you should look into the Linux API (In this post there are a few Linux API links), but if you're just looking for a daily script, this would be much easier to do with a shell script...
I already have the backup system coded in c++ and python (using mt, mtx, tar..etc).. To tell you about the background a little: The system reads some values from configuration file.. I realized that it would be easier to let users write on the configuration file which tape device they would like to use to do the backup. Also, the system checks if all of the information in the config file is valid (i.e. checks if the directories listed on the file really exist.. etc).
But when I tried to implement functionality (in c++) that could check if the listed tape device really exists, I could not find any helpful information..
The device doesn't quite behave like a file, or like a directory..
(I tried treating it like a file and a directory without any luck.)
So I'm wondering if there is any way for me to open the tape device from C++.
I know that in C, we can open anything with 'open' system call, but I'm not quite familiar with system calls in C++..
Thank you so much... (Thank you so much for the Links also. I'm looking at them right now!)