[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference iosg::all-in-1_v30

Title:*OLD* ALL-IN-1 (tm) Support Conference
Notice:Closed - See Note 4331.l to move to IOSG::ALL-IN-1
Moderator:IOSG::PYE
Created:Thu Jan 30 1992
Last Modified:Tue Jan 23 1996
Last Successful Update:Fri Jun 06 1997
Number of topics:4343
Total number of notes:18308

2319.0. "Yet another Postscript question..." by YOUWOT::ALLIN1 (ALL-IN-1 System Manager) Wed Feb 24 1993 14:06

    
    Hi,
    
    In V3.0 there ais some functionality that looks at a file and works
    out if its a postscript file or not. Can someone tell me if this is
    a callable function, and if so how to call it..??
    
    Thanks in advance.
    Caroline.
    
T.RTitleUserPersonal
Name
DateLines
2319.1NoIOSG::NEWLANDRichard Newland, IOSG, REO2-G/L2Wed Feb 24 1993 17:476
There is some code in the mail sub-system which looks at the content of
messages to see if the start with '!PS-Adobe'.  This functionality is not 
available as an ALL-IN-1 function.


Richard
2319.2History LessonSCOTTC::MARSHALLSpitfire Drivers Do It ToplessThu Feb 25 1993 12:5816
Strictly speaking, the test for a PostScript file should be whether the first
four characters of the file are "%!PS".

This comes from Unix-land, where the standard data-file formats (including
exectubales, object libraries, etc, I think) have a four-byte tag at the
beginning, signifying the file type.  It thus became standard practice for
specific text-file formats to use their first four bytes for an identifying
tag as well.

The test shouldn't look for the "-Adobe" part of the text, as this is just the
maker's name, rather than the file type.

So, back to the question in .0, it would be pretty easy to use TEXT_FILE within
ALL-IN-1 to read the first record of a file and see if it is PostScript.

Scott
2319.3The code does thisIOSG::NEWLANDRichard Newland, IOSG, REO2-G/L2Thu Feb 25 1993 13:415
I've looked at the source code and the first non-blank line has to start
with "%!PS-Adobe-". 


Richard
2319.4Actually its '%!' or '%!PS-Adobe'IOSG::TALLETTGimmee an Alpha colour notebook...Fri Feb 26 1993 09:5222
    
    	For the engineering purists among us, the PostScript language
    	reference manual (the "red" book) page 265:
    
    	"The very first line of every PostScript program ... should be '%!'
    	... (The Unix operating system has a scheme whereby the first 16
    	bits of a files's contents are a 'magic number' ... '%!' serves
    	as a 16-bit magic number that identifies PostScript files.) ...
    	A PostScript file is taken to be minimally conforming to the file
    	structuring conventions [of PostScript] if ... the first 11
    	characters of the program are '%!PS-Adobe-'. A Program is taken
    	to be fully conforming to the current version of the file
    	structuring convention if the version identifier consists of
    	'PS-Adobe-1.0' "
    
    	When Caroline was implementing this check, we decided that it was
    	too risky to just check for '%!', and since virtually all PS files
    	are (at least) partially conforming, the check should be for
    	'%!PS-Adobe-'.
    
    Regards,
    Paul