Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!uunet!mcsun!ukc!warwick!nott-cs!piaggio!anw From: anw@maths.nott.ac.uk (Dr A. N. Walker) Newsgroups: comp.lang.postscript Subject: Re: How can I tell if a file is "postscript" Message-ID: <1991Mar13.160331.25024@maths.nott.ac.uk> Date: 13 Mar 91 16:03:31 GMT References: <1448@vidiot.UUCP> <449@heaven.woodside.ca.us> <1460@vidiot.UUCP> Reply-To: anw@maths.nott.ac.uk (Dr A. N. Walker) Organization: Maths Dept., Nott'm Univ., UK. Lines: 45 In article jj1h+@andrew.cmu.edu (Joseph Jackson) writes: >"pscomm" looks at the first few bytes of the input stream looking for >the "%!" PostScript magic. If it doesn't find it, it will call >"enscript" to convert the (assumedly text) file to PostScript. Just so. What leaves me feeling slightly uneasy about this is that I now have to do something special to *list* a PS file. If file A contains a Pascal (say) program, and B contains a PostScript "program", then "lpr A" will list the Pascal, but "lpr B" will *obey* the PostScript. > this feature provides some degree of >compatibility with the old days of simple line printers. Think of how >many things would break if you suddenly needed to specify an lpr switch >when queuing straight text. Just so. Now think how many things break if "lpr B" lists B if the printer is a simple lineprinter but produces a fancy graphic if we upgrade it to a LaserWriter. What's more, there is a similar potential problem with every different printer language. We could find ourselves with 10 different printers on our network, each with a different [or, worse, the same] magic marker, so that all sorts of files must be "enscripted" by one of 10 different programs to print on some printers, and must not be to print on all the others. I don't know if there's a complete answer. Here, we simply shovel whatever comes to the LW spooler direct to the LW, and it's hard cheddar if it isn't PS (at least it usually fails quickly). If people want listings, they have to call an ASCII -> PS program. Since this can be packaged up into a short command, there's no hardship in practice. Indeed, there's an advantage in that the command can do clever things (like printing many lines per page) automatically, with no alteration to the spooler, which makes it easier to divert output to remote printers when necessary. Very few of our users ever call "lpr" directly any more -- I do it perhaps once a month, the rest of the time working through the packaged commands. -- Andy Walker, Maths Dept., Nott'm Univ., UK. anw@maths.nott.ac.uk