FTYP

Syntax

FTYP [(#channel)] or

FTYP (\file) (Toolkit II and THOR only)

Location

Toolkit II, THOR XVI, BTool

This function returns the file type of a file which is already open as #channel (the default channel is #3) or else the second variant can be used (which supports the Toolkit II default data device and sub-directories) to check a given file.

The file type is one byte in the file header which by convention represents the type of the file. There are only four standard types:

  • FTYP = 1 are executable jobs (normally suffixed _exe);

  • FTYP = 2 are Sinclair Relocatable Object File (SROFF) modules (normally suffixed _REL);

  • FTYP = 255 are sub-directories on level-2 and level-3 drivers;

  • FTYP = 0 are everything else.

However, some programmers use their own file types for their applications, for example:

  • FTYP = 2 may also signify sub-directory declaration files used by Ralf Biedermann’s flp utility and Hirschbiegel drivers;

  • FTYP = 3 are sub-directories on THOR computers.

  • FTYP = 4represents font files used by the PAINTER.

  • FTYP = 5 are pattern files used by the PAINTER.

  • FTYP = 6 or 11 are compressed screens generated by the PAINTER.

  • FTYP = 70 is used to represent separation files from packages distributed by the Intergroup Freeware Exchange.

WARNING

Sometimes machine code files (Toolkits, for instance) which should be loaded with LBYTES, LRESPR etc. have the file type 1. Executing such a file will lead to a crash in most cases, UNJOB changes the file type back to 0. Authors with a lot of skill write machine code which can be either executed as a job or loaded as a resident command executing the job from memory when called.

CROSS-REFERENCE

See HEADR for reading the whole file header and EX for executing jobs. FILE_TYPE does the same as FTYP but has a slightly different syntax.