Difference between revisions of "Pipe to identify CUPS printers"

From VistApedia
Jump to: navigation, search
m
m
 
Line 18: Line 18:
 
         Close P
 
         Close P
 
         Quit
 
         Quit
 +
 +
Compare to GetPrinters^TMGPRNTR(Printers)

Latest revision as of 16:08, 17 August 2009

Here is a code snippet that uses the pipe device to query Linux for the names of available CUPS printers. It returns them in a MUMPS array.

lpstat(DEVICE)  ;;

       ;; (CUPS has been configured with
       ;;  the desired printers defined.)
       ;;Sample run:
       ;; GTM>d lpstat^testing(.jlz)
       ;; GTM>zwr
       ;;    jlz=""
       ;;    jlz("HP_LaserJet_1100A")=""
       ;;    jlz("Photosmart_192.168.5.103")=""
       ;;
       New P Set P="pipe"
       Open P:(command="lpstat -a")::P
       For  Use P Read DEVICE Quit:$ZEOF  Do
       . Set DEVICE($P(DEVICE," "))=""
       . Quit
       Close P
       Quit

Compare to GetPrinters^TMGPRNTR(Printers)