XFILERSection: User Commands (1)
Updated: 12 April 1999
NAMExfiler - X file manager with drag and drop capabilities
SYNOPSISxfiler [-version] [directories ...]
DESCRIPTIONXfiler is a file manager program for the X window system formely known as files, and before that as xfm. It provides virtually all of the features that you would expect in a file manager - move around your directory tree in multiple windows, move, copy or delete files, and launch programs with simple mouse operations. Directory displays are updated automatically in regular intervals when the contents of the directory changes. User-definable file types let you specify a command to be executed when double-clicking on a file. Last but not least, xfiler can automatically mount and unmount special devices like floppies as you open and close the corresponding directories (mount points).
OPTIONSxfiler accepts a list of directories as command line arguments. For each directory, xfiler opens a file window. If no directory is given, the user's home directory will be used.
USAGEMost of it should be fairly obvious. There is one or more file windows in which directories (also termed folders) are displayed. In order to perform an action, you either select items and then invoke a menu operation, or you drag items from a file window to a second (maybe the same) file window. You can also double-click on an item to start a corresponding action (like launching an application, editing a file, or changing directories), and press the right menu button on an item to bring up a menu containing operations for a single file or application. File operations are accessed from the file window menu bar as usual.
The left-hand mouse button selects an item (and deselects all others in the same window). The second button toggles the selected state of an item.
You can drag with the left-hand button to another window to move files from one directory to another. The second button used in the same way will copy files. New file windows can be opened by simply dragging a directory icon to the root window.
The action taken when double-clicking on a file depends on the type of the file. If it is a directory, it is displayed in the file window. If it is an executable, the program is started. Other files are opened in the default editor (specified by the defaultEditor resource), unless another action is given in the rc file (see CONFIGURATION below).
Directories can be displayed in three different forms: tree (display subdirectories in tree-like form), icon (display directories and files as icons) and text (similar to ls -l). These options are selected from the View menu. In the tree form, clicking on the arrows takes you up or down one level.
Directory displays are updated automatically in regular intervals when the contents of the directory changes. You can also explicitly request a folder update by double-clicking on the directory name field of the corresponding file window.
File manipulation operations.
Operations dealing with directories and the file window.
Options for the directory display.
FILE POPUP MENU
Operations on a single file. This menu pops up when pressing the right mouse button on a directory or file icon.
RESOURCESVarious aspects of xfiler can be configured by changing corresponding resource settings in the applications default file. Some important resources are listed below:
CONFIGURATIONBesides the application resources, xfiler can be configured by means of a configuration file called .Filesrc located in your home directory. If this file is not found, xfiler search for a system-wide one. The location of such file may vary and can be adjusted using the corresponding X resource. It is a plain ASCII file which can be edited using any text editor. Any line in this file which starts with a hash sign (#) is interpreted as a comment; empty lines are ignored. Note that there exists a line splitting this file in two parts: file type configuration and device configuration. Also, if xfiler has been compiled with the MAGIC_HEADERS option then another file called FilesMagic (system-wide) or ~/.FilesMagic is used (see below).
FILE TYPE CONFIGURATIONThe first half of the Filesrc file specifies the types of ordinary (non-executable, non-directory) files which xfiler should recognize. Each file type associates a pattern with an icon and two different kinds of actions (commands to be executed on the file). If xfiler has been compiled with the MAGIC_HEADERS option then it is possible to specify icons (but not actions) for directories and executables as well. Each line has the following format:
As indicated, the different fields are separated by a colon (use \: to escape the : character, and \\ to escape the backslash character itself). The meaning of these fields is explained below.
If an action field is empty, the corresponding action defaults to ``do nothing.'' For instance, the following entry defines an icon and an EDIT push action for .c files:
As another example, here is an entry for compressed (i.e. gzipped) tar files. The push action causes the archive to be extracted, while the drop action replaces the contents of the archive with the files which have been dragged onto the archive:
*.tar.gz:files_taz.xpm:exec tar xfvz $1:exec tar cfvz $*
(Note the use of the shell's exec command. Since actions are invoked through the shell, it is often useful to replace the shell with the actual command which is to be executed, in order to conserve memory space on small systems.)
It is possible that different patterns given in the filesrc file overlap. In this case xfiler uses the first pattern which matches. Therefore you should always list the more specific patterns first. For instance, the following two entries specify what to do with compressed tar files (specific case) and other .gz files (default case):
*.tar.gz:files_taz.xpm:exec tar xfvz $1:exec tar cfvz $* *.gz:files_z.xpm:exec gunzip $1:
xfiler also enables you to prompt for additional parameters before an action is executed. This is generally more useful with application entries than with file actions, and will therefore be described in the context of application configuration, see PARAMETER DIALOGS below.
DRAG AND DROP OPERATIONSxfiler handles the following DND types: DndFile, DndExe, DndLink, DndFiles, DndRawData and DndText. DndText and DndRawData are ignored unless the drop occurred over a dir icon or over an empty region of the file window (called iconbox). Over the iconbox or a dir icon a new file is created and the DND data is thrown into it. Other kinds of drops are treated according to the target. Over icons with drop actions the corresponding action is executed in the directory of the target; the target name and the DND data are passed as parameters. When the drop occurs over an executable file that file is executed in its directory and the DND data is used as parameters. Over dir icons or the iconbox, a distinction between internal and external (drops that come from another application) is made; external drops are ignored while internal ones yield move/copy operations. Drop made over other kind of icons are ignored.
MAGIC HEADERSWhen compiled with the MAGIC_HEADERS option, xfiler can determine file types using the magic numbers contained in the files.
The magic numbers are described in a configuration file whose path is obtained from the magicFile resource. The format of the file is the same as that of the magic(5) file, with some extensions like regular expression matching. (See xfmtype(1).)
There are five built-in types which are used if all the patterns in the magic file fail:
To specify a magic file type you include it between angle brackets at the beginning of the pattern field:
<GIF>:files_gif.xpm:exec xpaint $1:
or combined with a filename pattern:
In the latter case, the file must meet both conditions, i.e. be an ASCII file and have a .cc suffix.
To include angle brackets in the type or the pattern you must escape them using backslashes.
If xfiler is compiled with the MAGIC_HEADERS option, it is also possible to specify custom icons for directories and executables. For this purpose, the magic file distributed with xfiler provides magic file types named <DIR>, <EXEC>, etc. For instance, here is an entry which specifies a special icon for hidden directories:
In the same way you can also override the built-in icons for displaying arbitrary directories and executables:
<DIR>..:parent_dir.xpm:: <DIR>:plain_dir.xpm:: <DIR LNK>:link_dir.xpm::
DEVICE CONFIGURATIONThe device configuration section of filesrc, lets you specify which mount points xfiler should keep track of, and which actions to perform in order to mount and unmount the corresponding file systems. This allows you to access file systems on special devices such as floppies, CD-Roms, etc. in a transparent way. All you have to do is to enter a directory named in filesrc (e.g. by opening a file window on it), and xfiler will automatically perform the corresponding mount action for you. Likewise, if you leave such a directory, xfiler invokes the corresponding unmount action. (CAUTION: You still have to take care that you unmount a file system, e.g. by closing every file window which has been opened on it, before you physically remove the corresponding medium.) Alternatively, it is recommended that you use external utilities like supermount to perform such operations without any risk of data loss.
An entry of the devide section has the following format:
The directory field denotes the mount point of the file system, mount-action the command to be executed in order to mount the file system, and umount-action the command for unmounting the file system. Here is a ``typical'' entry from a filesrc file:
/disk/a:mount -t msdos -o user /dev/fd0 /disk/a:umount /disk/a
Of course, the details of how to mount a floppy file system may vary from system to system, and you might have to take special actions if you want to use mount as an ordinary user. See mount(8) for details.
PARAMETER DIALOGSxfiler lets you prompt the user for additional parameters when a push or drop action is invoked. In such a case, a dialog form appears, with one field for each parameter, into which the user can enter the required arguments. Currently, no checking is done on the supplied parameters; in fact, the user can simply leave all fields empty. Parameters are specified in an action using the form
where parameter-name is an arbitrary string not containing the % character, which will be displayed in the dialog form. (As usual, a literal % character can be escaped with the backslash.) xfiler replaces each such %...% construct with the corresponding value entered by the user.
CONSOLE OUTPUTPrograms started by xfiler inherit their standard output and error streams from xfiler. Therefore, if you start xfiler from your session or window manager instead of an xterm, you should redirect xfiler's standard output and error to something which you can read while xfiler is running, if the window manager does not already do that for you. Usually, you will reassign both stdout and stderr to /dev/console, using the command:
xfiler >/dev/console 2>&1
ICONSxfiler supports icons in both the X bitmap and Arnaud Le Hors' XPM format. A collection of useful icons is included in the distribution.
SEE ALSOX(1), xconsole(1), xterm(1), mount(8), Arnaud Le Hors: XPM Manual. The X PixMap Format, Groupe Bull, 1993. The Drag and Drop HOWTO by Cesar Crusius.
CAVEATS AND BUGSxfiler catches the TERM signal to gracefully terminate the program, unmounting all open file systems which have been mounted by xfiler. However, some window and session managers may not send TERM signals to their client applications when terminating an X session. Therefore it might be necessary to explicitly quit xfiler or manually close file windows before exiting X.
xfiler depends on your shell - see resource BourneShells.
COPYRIGHTCopyright (c) 1990-1993 by Simon Marlow
Copyright (c) 1994, 1995 by Albert Graef
Copyright (c) 1996 by Andre Hentz
Copyright (c) 1999 by Ulric Eriksson
AUTHORSThe original version of this program (called xfm) was written by Simon Marlow (firstname.lastname@example.org) at the University of Glasgow. Albert Graef (email@example.com) at the University of Mainz is the author of the lastest xfm version (1.3.2) which contains many bug fixes and enhancements. Other people have contributed additional features: Dave Safford (firstname.lastname@example.org; automatic folder updates); Robert Vogelgesang (email@example.com; shell detection code); Juan D. Martin (firstname.lastname@example.org; magic headers); Kevin Rodgers (email@example.com; Filter option); Scott Heavner (sdh@falstaff.MAE.cwru.edu; View option); Brian King (ender@ee.WPI.EDU; default values in parameter dialogs).
In 1996, this program underwent a complete reformulation in order to be able to work together with DnD (the Drag and Drop protocol by Cesar Crusius). Many features of earlier versions were removed due to the new role played by xfiler in the context of OffiX. OffiX is an expandable environment built around DnD and aimed to give novice and expert users a comfortable and common desktop.
In 1999 this code was snarfed by Ulric Eriksson to become part of Siag Office. At the same time, the user interface was redesigned to conform to the other Siag cousins. Intended as a small baseline file manager, it is available for all file management needs, but can be configured away.
Ulric Eriksson - April 1999 - firstname.lastname@example.org