Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP Visual User Environment 3.0 User's Guide > Chapter 20 More About Filetypes

Reference: Filetype Definitions

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Glossary

 » Index

Reference sections cover:

  • General syntax.

  • A summary of fields.

  • An alphabetical listing of all the fields.

See Also. 

General syntax for filetype definitions

Field structure.  A filetype definition consists of a series of fields. The definition begins with the mandatory FILETYPE field and ends with the keyword END. Each field begins with a keyword and ends with a newline character:

   FILETYPE    filetype_name

     KEYWORD  value

     KEYWORD  value

      ...

   END

Spaces.  Leading spaces in a field are ignored. Therefore, you can use spaces to indent lines for easier reading.

Fields longer than one line.  The \ character at the end of a line indicates that the field continues onto the next line.

Comments.  To comment a line, use the # character at the beginning of the line. The # can be proceeded by spaces. You cannot comment partial-lines.

Example.  This filetype definition creates a filetype for read-only files whose filenames follow the naming convention *.doc. It assumes that the View_Document action is defined in the database.

   FILETYPE        ReadOnlyDocument

     DESCRIPTION   This document is not writable. Double-clicking \

       runs your editor with a read-only copy of the file.

     FILE-PATTERN  *.doc

     MODE          !d&!x&!w

                   # The file cannot be a directory, executable, or writeable.

     L-ICON        read_only.l.bm

     S-ICON        read_only.s.bm

     ACTIONS       View_Document

   END

Example.  This definition creates a filetype for directories named Demo_n where n is 0 through 9.

   FILETYPE          Demo_directory

     DESCRIPTION     This is a directory.  Double-click to open it.

     FILE-PATTERN    Demo_[0-9]

     MODE            d

     L-ICON          control.l.bm

     S-ICON          control.s.bm

     ACTIONS         OpenInPlace,OpenNewView  

   END

Example.  The following filetype applies to all files named chnn.xxx where n is 0 through 9, and xxx is any three-character dot extension. The filetype uses the default icons.

   FILETYPE

     DESCRIPTION     Chapter file for the project document.

     FILE-PATTERN    ch[0-9][0-9].???

     ACTIONS         Edit,Print

   END

Example.  This filetype creates a special icon for directories for which you lack both read and write permission.

   FILETYPE         Directory_With_No_Permissions

     DESCRIPTION    You cannot open this directory unless you are logged \

                    in as root.

     MODE           d&!r&!w

     L-ICON         admindirectory.l.bm

     S-ICON         admindirectory.s.bm

     ACTIONS        OpenInPlace,OpenNewView

   END

See Also. 

Summary of Filetype Fields

Required fields. 

Field

Description

FILETYPE

Begins the definition and contains the filetype name.

END

Ends the definition.

Icons. 

Field

Description

L-ICON, S-ICON

Absolute path of the large (L) and small (S) icons in File Manager. (Default is data file icon)

DESCRIPTION

A description of the filetype displayed when the user obtains item help on the icon.

File recognition fields. 

Field

Description

FILE-PATTERN

Describes the pattern for matching the file name.

PATH-PATTERN

Describes the pattern for matching the entire path.

MODE

Mode requirements for the file. Use characters d, r, w, and x, for directory, readable, writable, and executable. Use & or logical AND, ! for logical NOT. (Default is non-directory, other permissions irrelevant).

CONTENT

Specifies the portion of the file to search and the content to search for.

Behavior field. 

ACTIONS

List of the entries in the Actions menu, separated by commas. The first action in the list is the default (double-click) action.

ACTIONS field

  • Lists the actions to be displayed in the Actions menu.

  • Optional.

  • Defaults to no actions. The Actions menu is inactive.

This field contains a list of actions displayed in the file manager Actions menu when a file of this filetype is selected. Items in the list are separated by commas. There can be no spaces in the list.

The first action in the list is the default action taken when the user double-clicks the file icon.

Each action must have a corresponding entry in the action definition database.

Example.  The following ACTIONS field lists four actions for the Actions menu.

   ACTIONS  Edit,Print,Compress,Archive

CONTENT field

  • Describes the content requirements for the filetype.

  • Optional.

  • Can be used in conjuction with FILE-PATH or FILE-PATTERN.

Content-based filetyping searches a specified portion of the file for the existence of a particular string or number. The search starts at the position starting_byte and ends at the position ending_byte.

NOTE: Wide-spread use of content-based filetyping will result in lower system performance. You should use name- and location-based filetyping instead wherever possible.

String contents.  Use the syntax:

   CONTENT  starting_byte ending_byte string string

Numeric contents.  Use one of the following syntaxes, depending on the type of number:

   CONTENT starting_byte ending_byte byte hexadecimal_number

   CONTENT starting_byte ending_byte short decimal_number

   CONTENT starting_byte ending_byte long decimal_number

Search is conducted from the starting_byte to ending_byte.

Example. 

CONTENT Value

Interpretation

0 30 string Chapter

All files containing Chapter in the first 30 bytes.

0 20 byte 0xF

All files containing a byte F in the first 20 bytes.

FILE-PATTERN field

  • Specifies the filename requirements for the filetype.

  • Optional.

  • Defaults to *.

Use the FILE-PATTERN field to specify the filename criteria for the filetype.

Character

Meaning

?

Matches any single character.

*

Matches any sequence of characters (including a null string).

[cc...]

Matches any of the characters (c) enclosed in brackets.

[c-c]

Matches any of the characters in the range c through c.

Example. 

FILE-PATTERN Value

Interpretation

*.c

All files ending with .c.

chapter?.text

All files named chapterx.text, where x is any character.

chapter[1-9].text

All files named chapterx.text, where x is a character in the range 1 through 9.

L-ICON and S-ICON Fields for filetypes

  • Specify the icons for the filetype.

    • L-ICON: displayed in File Manager views By Name and Icon.

    • S-ICON: displayed in File Manager views By Name and Small Icon.

The value for the L-ICON and S-ICON fields can be:

  • The absolute path.

  • A filename. The system searches the icon search path.

The default icons are in /usr/vue/icons.

Icon file names.  There are no name requirements. You can use .bm or .pm extensions to distinguish between bitmaps and pixmaps.

Icon sizes.  Icons can be any size. These are the default sizes.

Icon Type

Icon Size (Width×Height)

Data file L-ICON

22 × 30 pixels

Data file S-ICON

14 × 17 pixels

Executable file L-ICON

32 × 32 pixels

Executable file S-ICON

16 × 16 pixels

Directory L-ICON

30 × 23 pixels

Directory S-ICON

20 × 16 pixels

See Also. 

MODE field

  • Contains a boolean expression specifying the mode requirements for the file.

  • Optional.

  • The default value is a non-directory, all other permissions are irrelevant.

The boolean expression is built from the following operators and values:

Character

Meaning

!

Logical operator NOT.

&

Logical operator AND.

d

The file is a directory.

r

The file is readable by the current user.

w

The file is writable by the current user.

x

The file is executable by the current user.

You can simulate a logical OR operator by defining the filetypes more than once using different values in the MODE field.

Example.  The following MODE fields specify criteria for file typing.

!d

Not a directory.

!d&!x

Non-directory, not executable by the user.

!d&r

Non-directory, must be readable by the user.

Example.  If the mode criteria involves a logical OR, you must define the filetype twice using the two OR criteria. The filetype Doc_Utility, below, applies to an executable or directory with the naming convention Doc*.

   FILETYPE         Doc_Utility

      FILE-PATTERN  Doc*

      MODE          d

       ...

   END



   FILETYPE         Doc_Utility

      FILE-PATTERN  Doc*

      MODE          x

       ...

   END

PATH-PATTERN field

  • Describes the location (path) requirements for the filetype.

  • Optional.

  • Defaults to *.

PATH-PATTERN filetyping is based on the entire path to the file: hostname:/path/filename.

Character

Meaning

?

Matches any single character.

*

Matches any sequence of characters (including a null string).

[cc...]

Matches any of the characters (c) enclosed in brackets.

[c-c]

Matches any of the characters in the range c through c.

Example. 

FILE-PATH Field Value

Interpretation

hpaaa:$HOME/templates/*

All files in the directory $HOME/templates on system hpaaa.

*:*/Mail/*

All files in any Mail directories and their subdirectories on any system.

*:/doc/*/chapter[1-9].text

All files in subdirectories of /doc named chapterx.text on any system.,

hpcvxlp:/doc/sysadm/*.b

All files ending in .b in the /doc/sysadm directory or any of its subdirectories on system hpcvxlp.

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© © 1989, 1990, 1991, 1992, 1995 Hewlett-Packard Development Company, L.P.