SourceFiles.org - Use the Source, Luke
Home | Register | News | Forums | Guide | MyLinks | Bookmark

Related Sites

Latest News
  General News
  Reviews
  Press Releases
  Software
  Hardware
  Security
  Tutorials
  Off Topic


Back to files

heh version 1.3.1


SYNOPSIS

heh [options | filenames]


DESCRIPTION

heh uses user specified applications to open files based on the filename extension. The user builds and maintains a database of extension/application pairs in a single file: ~/.extensions is the database of applications that are used to open files - each line designates if the line applies when there is an X display or not. There is also an optional system wide file, /etc/extensions_ignore, that is set (by root) to make heh ignore particular files (such as .so, .o, .a). These override any user defined preferences.

heh supports associated/equivalent file types, meaning the user can define several extensions that are either related (.c & .h) or equivalent (.htm & .html) to be opened with the same application.

heh also supports system-wide aliases for things like scripts (this is just to save time for common scripts). They go in /etc/extensions_alias.

Note: when giving an extension as an argument, the '.' is not included, unless you are updating a pseudo extension (where the dot signifies that it is a pseudo extension). More on this a little later.


OPTIONS

-u {-X | -term | -both | -all | -f} ext app Updates the default database (X or term). Sets all files with extension "ext" to be opened with application "app". If the extension is not in the database, the entry is added. If it already exists, it changes the entry.

-ua {-X | -term | -both | -all | -f} ext app Sets all extensions associated/equivalent to "ext" to be opened with "app". If the extension is not in the database, the program prints a warning and aborts.

-e {-X | -term | -both | -all | -f} ext1 ext2 ... Sets the given extensions to be equivalent (i.e., be opened by the same application). At least one of the listed extensions must be in the database.

-i app filename1 filename2 ...
Inline updating and opening. Updates the extensions of the files and opens them with the new app.

-r {-X | -term | -both | -all | -f} ext ... Removes the extension(s) from the database if it exists.

-qa {-X | -term | -both | -all | -f}
Queries all extension/application pairs for the specified type of display. If no display type is given, it defaults to the current display.

-qe {-X | -term | -both | -all | -f} ext Queries an extension to find whether or not it is in the database and its application.

-qp {-X | -term | -both | -all | -f} app Queries an application to find the file types that it will open, if any.

-ie ext ...
Sets an extension to be ignored (like .old and .bak). Files with these extensions will still be opened, but with the next available extension for the file. For example, if .old is set to be ignored, foo.pl.old will be opened by whatever is set to open .pl files.

-v, --version
Print version number.

-h, --help
Print help menu.


FILES

~/.extensions
This is the extension/application pair database (and a little bit of a preferences database). The file starts with a line like this: regress=no
to specify whether regression is OK. (Regression means that if there is an X display, and an application for a specific file type has not been defined in the X database, but it HAS been defined for the terminal-only database, it's okay to use the application defined for the terminal environment. Make sense?) Subsequent lines go like this:
{ X | T | F } (extlist) [handler]
The extlist is a comma-delimited set of file extensions that should be handled the same way. They are "equivalent", in a sense. The handler can be an application (with or without command-line arguments, defined either as a full path or as an application that is in the current PATH), a shell-script (look at the examples in extensions_aliases for details on the format), or a script alias (as defined in /etc/extensions_aliases). Comments can be added to this file -- anything after a # sign in a line is treated as a comment.

/etc/extensions_ignore
This is the optional system-wide ignored file type database. It is in the format:
ext1,ext2,ext3,...

/etc/extensions_alias
This is an optional system-wide set of aliases (intended for scripts). A sample is included... of the form:
(.._ALIAS_NAME_..) [some script]


PSEUDO EXTENSIONS

heh uses pseudo extensions to open files such as URLs, directorys, files with no extensions, and mailto's. The user may edit the entries for these types of files using these for the extension arguments (and make sure you use the '.' before them):

.DIRECTORY
Self explanatory. You can set netscape, midnight commander, a graphical file manager, ls or whatever you want to open a directory.

.URL
These are any files that begin with http://, ftp://, or file://. (anything of the form whatever://somethingelse)

.MAILTO
An email address. Could be opened with an application such as netscape or some mailers.
For example: (.MAILTO) [mutt `echo "%f" | sed 's/^\(.*\)\:\(.*\)$/\2/g'`]

.NOEXTENSION_T
These are files without extension that are text.

.NOEXTENSION_B
These are files without extensions that are determined to be binary.

.DEFAULT
If this extension is defined, then whenever an unknown file extension is encountered, the user will not be prompted for a handler - the handler for this extension will be used.


NOTE

heh will attempt to open the target of symbolic links, not the link itself. Thus, the extension of the link is ignored, and the extension of the target will be used.


AUTHORS

Jeremy Doolin - jdoolin@cs.ohiou.edu
Kyle Wheeler - kwheeler@cs.ohiou.edu


Other Sites

Discussion Groups
  Beginners
  Distributions
  Networking / Security
  Software
  PDAs

About | FAQ | Privacy | Awards | Contact
Comments to the webmaster are welcome.
Copyright 2006 Sourcefiles.org All rights reserved.