sjm0@bunny.UUCP (Stu Mcgraw) (02/24/88)
I would like some way of looking at the contents of a
file and determining whether or not the file is a VMS
executable image (regardless of the file's name).
Since this needs to be callable from a program, solutions s
uch as using ANALYSE/IMAGE won't work for me. From what
ANA/IMAGE tells me though, I gather there is an image
header record in the file. Does anyone know if this
header, or other records, contains any "magic numbers"
I could look for? Obviously this will not guaranty an
accurate determination but I don't mind occasionally
thinking a data file is an executable (but not visa versa).
If anyone can give me (or point me to) information about
the format of image files, I will be most greatful.
The reason I want to do this is that all files created by
Eunice (a UNIX emulator that runs on VMS) are created with
512 bytes fixed length records. Internally though these files
have a STMLF format and so, some time ago, I wrote a program
to diddle the file header to change the record type to STMLF.
This works fine except for executables (the VMS image activator
complains loudly when it tries to read a STMLF file) so I would
like to modify the program to not alter files if they are an
executable.
-- Stu
--
Stuart McGraw (617)466-2525 GTE Laboratories
{hsuc6,harvard}!bunny!sjm0 40 Sylvan Road
sjm0%gte-labs.csnet@csnet-relay Waltham MA 02254