test_udevcdrom.cc 345 B

1234567891011121314151617181920
  1. #include <apt-pkg/cdrom.h>
  2. #include <stdio.h>
  3. #include <assert.h>
  4. int main()
  5. {
  6. int i;
  7. pkgUdevCdromDevices c;
  8. assert(c.Dlopen());
  9. vector<CdromDevice> l;
  10. l = c.Scan();
  11. assert(l.size() > 0);
  12. for (i=0;i<l.size();i++)
  13. std::cerr << l[i].DeviceName << " "
  14. << l[i].Mounted << " "
  15. << l[i].MountPath << std::endl;
  16. }