Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!van-bc!halliday From: halliday@van-bc.wimsey.bc.ca (Laura Halliday) Newsgroups: comp.lang.postscript Subject: Re: How can I tell if a file is "postscript" Summary: An interpreted language. Therefore... Message-ID: <2873@van-bc.wimsey.bc.ca> Date: 8 Mar 91 15:37:17 GMT References: <1448@vidiot.UUCP> <487@appserv.Eng.Sun.COM> <1461@vidiot.UUCP> Organization: The Lambda Continuum Lines: 23 With all the discussion of %! and friends, the original question, i.e. can you look at a file and tell if it's PostScript or not, appears to have gotten lost in the shuffle. Document Structuring comments notwithstanding, the problem is that PostScript is a language that was designed to be interpreted, and thus has rich operators and simplistic syntax. It's a lot easier to look for syntax than for vocabulary. Hence the problem. I went through this issue in another forum where somebody wanted to make a system that you could mail files to, and it would decide how to print them. The decision was to look for %!, and if it was there, print as PostScript. If not, make a few tests (e.g. look for parentheses) and if these tests were inconclusive, try printing as PostScript anyway to avoid producing reams of paper covered with gibberish if you guessed wrong. Oh yes - and fire the next person who writes an application that generates PostScript output that doesn't conform to the Document Structuring Conventions. ...laura