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

Creating Filetypes

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Glossary

 » Index

Creating a filetype involves:

  • Choosing the criteria used to type the file.

  • Defining the filetype in the database.

  • Creating any necessary icons for the filetype.

See Also. 

To define a filetype in the database

  1. Open an existing database file or create a new one. New database files must use the naming convention filename.vf and be located in directories on the database search path:

    • /etc/vue/config/types for system-wide filetypes.

    • /HomeDirectory/.vue/types for personal filetypes.

    • /etc/vue/config/export for filetypes to be exported to other systems.

  2. Add the new filetype definition to the file. See “Reference: Filetype Definitions”.

  3. Store the file.

  4. If necessary, create the bitmaps for the filetype.

  5. If necessary, create the actions listed in the ACTIONS field of the filetype defintion.

  6. Double-click ReloadActions in the System_Admin subdirectory of the General Toolbox.

See Also. 

To specify the criteria for categorizing the file

  • Choose from the following criteria:

    Criteria

    Description

    File name

    The filename must match a specified pattern. Use the FILE-PATTERN field.

    File location

    The path must match a specified pattern. Use the PATH-PATTERN field. Use the form hostname:/path.

    File contents

    A specified portion of the file's contents must match specified data. Use the CONTENT field.

    File mode

    The file must possess the specified permissions (read, write, execute, directory). Use the MODE field.

You can use more than one criteria for a filetype. However, you should not use the FILE-PATTERN and PATH-PATTERN criteria in the same filetype.

NOTE: Use of content-based filetyping will result in lower system performance. Wherever possible, use name- and location-based typing instead.

Example.  The Executable_Object_File filetype defined below applies to all files named with .o extensions that are executable (x) and (&) non-directories (!d).

   FILETYPE           Executable_Object_File

     FILE-PATTERN     *.o

     MODE             x&!d

      ...

   END

Example.  The QS_Source_File filetype defined below applies to all files with .c extensions in subdirectories of /projects/QS on any host.

   FILETYPE          QS_Source_Files

     PATH-PATTERN    *:/projects/QS/*/*.c

      ...

   END

Example.  The Final_pcl_graphics filetype applies to all files named QS*.pcl, located on host hphere, that are read-only (!w) and (&) not directories (!d) and not executable (!x).

   FILETYPE          Final_pcl_graphics

     PATH-PATTERN    hphere:*/QS*.pcl

     MODE            !w&!d&!x

      ...

   END

Example.  The Wingz_data filetype applies to all files with write permission containing the string WNGZ in the first 100 bytes.

   FILETYPE        Writable_Wingz

     CONTENT       0 100 string WNGZ

     MODE          w&!d

      ...

   END

See Also. 

To associate actions with filetypes

  1. Use the ACTIONS field in the filetype definition to list the actions that will appear in the File Manager Actions menu. The first action in the list will be the default (double-click) action.

  2. Define the actions listed in the filetype definition. If you want the action to apply only to that filetype, use the ARG-TYPES field in the action definition.

Example.  The following filetype definition creates a filetype for special "readme" files created by your system administrator that use the naming convention *.rm.

   FILETYPE SysReadMe

      FILE-PATTERN  *.rm

      L-ICON         SysReadMe.l

      S-ICON         SysReadMe.s

      ACTIONS        Open,Edit

   END

A special Respond action is defined below for the file. It opens a writeable copy of the file in Text Editor. When the file is saved and Text Editor is exited, the file is mailed to the system administrator (mail address sysadmin@utd).

   ACTION Respond

     ARG-TYPES     SysReadMe

     EXEC-STRING  /usr/bin/sh -c 'cp %(File)Arg_1% $HOME/readme.temp;       \

                   chmod +w $HOME/readme.temp;                          \

                   vuepad $HOME/readme.temp;   n                        \

                   cat $HOME/readme.temp | /usr/bin/mailx sysadmin@utd; \

                   rm $HOME/readme.temp' 

     WINDOW-TYPE   NO-STDIO

   END

Example: creating a personal filetype

The following steps create a personal filetype for graphics files for the QS project. The typing criteria is based on the entire path— the files must be on system hpaaa in subdirectories of /HomeDirectory/QS/graphics and end in *.tiff.

Example. 

  1. Create the file /HomeDirectory/.vue/types/Project_graphics.vf, containing:

       FILETYPE          Project_Graphics
    
          DESCRIPTION    Graphics file for the QS project. Double-click the \
    
                         icon to see the graphic.                           \
    
          L-ICON         QSgraphics.l.bm
    
          S-ICON         QSgraphics.s.bm
    
          PATH-PATTERN   hpaaa:/$HOME/QS/graphics/*/*.tiff
    
          ACTIONS        View_Graphics
    
       END
    

  2. If necessary, create the two icons specified in the filetype defintion.

  3. If necessary, create the View_Graphics action.

  4. Double-click ReloadActions in the System_Admin subdirectory of the General Toolbox.

Example: creating a system-wide content-based filetype

The following steps create a system-wide filetype for shar-ed files.

  1. Log in as root on your system.

  2. Create the file etc/vue/config/types/Shar_file.vf, containing:

       FILETYPE        Shar_file
    
          DESCRIPTION  This is a shar-ed file.  To unpack it, \
    
                       double-click the icon.
    
          CONTENT      0 80 string This is a shell archive.
    
          L-ICON       shar.l.bm
    
          S-ICON       shar.s.bm
    
          ACTIONS      Unpack
    
       END
    

  3. If necessary, create the two bitmaps specified in the filetype definition.

  4. If necessary, create the Unpack action.

  5. Double-click ReloadActions in the System_Admin subdirectory of the General Toolbox.

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.