On 2020-12-04 19:47, ToddAndMargo via perl6-users wrote:
Hi All,
Fedora 33
I there a way to use what is on
https://docs.raku.org/type/Semaphore
to print out a list of my available printers?
Many thanks,
-T
This is the C way, although it shows deleted printers as well:
#include <iostream>
#include <cups/cups.h>
int main() {
cups_dest_t* dests;
int nCount = cupsGetDests2(CUPS_HTTP_DEFAULT, &dests);
for (int i = 0; i < nCount; i++) {
cups_dest_t dest = dests[i];
std::cout << dest.name << std::endl;
}
}
$ list-printers
B4350
Cups-PDF
Cups_PDF_rn6 <-- deleted
Oki_B4350_on_dev_lp0_rn6 <-- deleted
Virtual_PDF_Printer
Virtual_PDF_Printer_rn6 <-- deleted