🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.postscript
Article #1746

Re: Need an intelligent Ascii - PS Filter

#1746
From: Jim Dailey
Date: Wed, 12 Aug 1992 13:39
33 lines
2165 bytes
carl@SOL1.GPS.CALTECH.EDU (Carl J Lydick) writes:
>gary@iscnvx.lmsc.lockheed.com (Gary Henderson) writes:
>>Sorry to jump into the middle of a thread, but starting a file with
>><control-D>%! is NOT a reasonable thing to do.  The purpose of the %! at the
>>beginning of the file is to create a signature in the first 16 bits that
>>identifies the file as a PostScript fille.  If the file starts with
>><control-D>%!, the first 16 bits are based on <control-D>%, not %!, and the
>>signature is therefore not one of a PostScript file, conforming or otherwise
>>(see pg 265 of edition 1 of the Red Book).
>
>Sorry, but that's just more UNIX magic-number bullshit.  For your information,
>UNIX is NOT the only operating system in the world.

As Gary said, the requirement for the '%!' is from the Adobe Red Book.  It is
not something Bell Labs made up, and it certainly is not bullshit--it is
simply a standard set by Adobe that is not followed very well.  You don't need
to know anything about UNIX magic numbers to make use of this standard.  As
an example, here is an awk program to tell you if a file is PostScript:

{ if ($0 ~ /^%!.*/)
     {printf "This is a postscript file.\n"}
  else
     {printf "NOT a postscript file.\n"}
  end
}

A similar function could be written in BASIC on a PC, LISP on an Explorer
or FORTRAN on a Honeywell 6000.  The fact that the standard fits into the UNIX
magic number scheme does NOT make it any less useful.
---
Jim  jdailey@dadd.ti.com
   TI pays absolutely no attention to me or my opinions; therefore,
   the foregoing posting cannot possibly represent TI's viewpoint.
Technical Details
Message-ID: <1992Aug12.133946.15553@csc.ti.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!cs.utexas.edu!csc.ti.com!tilde.csc.ti.com!fstop.csc.ti.com!usenet
References: <1992Aug12.060638.21409@cco.caltech.edu>

Show Full Headers
Complete Article Headers
Newsgroups: comp.lang.postscript
Path: arc1-ca.pugleaf.net!sparky!uunet!cs.utexas.edu!csc.ti.com!tilde.csc.ti.com!fstop.csc.ti.com!usenet
From: jdailey@dadd.ti.com (Jim Dailey)
Subject: Re: Need an intelligent Ascii - PS Filter
Message-ID: <1992Aug12.133946.15553@csc.ti.com>
Sender: usenet@csc.ti.com
Nntp-Posting-Host: iccl.dadd.ti.com
Reply-To: jdailey@dadd.ti.com
Organization: Design Automaton Div., Texas Instruments, Inc.
References: <1992Aug12.060638.21409@cco.caltech.edu>
Date: Wed, 12 Aug 1992 13:39:46 GMT
Lines: 33