Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!cs.utexas.edu!rice!uw-beaver!milton!ogicse!intelhf!ichips!iwarp.intel.com!gargoyle!chinet!les From: les@chinet.chi.il.us (Leslie Mikesell) Newsgroups: comp.lang.postscript Subject: Re: How can I tell if a file is "postscript" Message-ID: <1991Mar19.171530.6904@chinet.chi.il.us> Date: 19 Mar 91 17:15:30 GMT References: <1991Mar13.160331.25024@maths.nott.ac.uk> <13109@wraxall.inmos.co.uk> <1991Mar19.052103.9026@ferret.ocunix.on.ca> Organization: Chinet - Chicago Public Access UNIX Lines: 28 In article <1991Mar19.052103.9026@ferret.ocunix.on.ca> clewis@ferret.ocunix.on.ca (Chris Lewis) writes: >A truly smart spooler would figure out what printers are appropriate >for a given magic cookie, and route the results there. Otherwise, >you're expecting everybody to remember which printers can handle a given >format and/or remember lots of obscure options to tell the printer to >go into the correct mode. Ah, but the appropriate thing to do with a particular type of data may depend on who sent it and what command line options were given as well. I have DOS users connected to a network so the print jobs are passed off to the unix print spooler. We can connect any of LPT1, LPT2, and/or LPT3 to arbitrary unix processes, but it is just too complicated for the users to (a) make an appropriate device link first, then (b) set their application to use the same device with corresponding output. I ended up writing a front-end program that first tries to identify the input by matching codes found in a "codes" file. Then it looks (in order) for a file for the user, the destination (passed with a -d on the command line), or the default "commands" file, where the name found in the codes lookup is associated with a command to execute to properly print the file. An assortment of command line options for the program and %-escape substitution in the final command expansion allow passing along the original parameters from the DOS spooler if desired. I can post this if anyone else has the same problem. Les Mikesell les@chinet.chi.il.us