Please help me with it and also suggest some notes or links associated with the question.
Please explain the logic also.

Code: Select all
eject /dev/sr0
yep, it is os specific . But from the way the question was phrased my brain heuristic returned windowsLove4Boobies wrote:I meant your target environment. For example, Thomas assumed Windows.
And too lazy to read my post just prior to yours that tell which ioctl calls.Thomas wrote:PS : in *nix environments, you probabliy can eject with an icotl call ( basically search the web for the parameters . too lazy to do the searching for the poster ) .