fv

Purpose

Uses a configuration file to show a view of whatever files and directories you want, collapsing and expanding directories, and allowing directories to be viewed using fm and files to be viewed using fv and hv.

Syntax

fx [ config-file-name ]

Description

If config-file-name is not specified, fx will look for a file called fx.config in the current directory, and if that is not found, for a file called fx.config in the user's home directory.

Items in the configuration file can be lists of items or standalone items. A bottom-level item can be either a directory or a file, and if it is a file, can either be a binary or a text file.

Where an item is a list of items, it can be expanded to display the subsidiary items and collapsed to show the top-level entry only.

Functions

Key Action
Escape Exit
F1 Show help screen
Enter Expandable lines with '+' by them - expand
Expandable lines with '-' by them - collapse
Other lines - view directory or file
+ Expand expandable line
- Collapse expandable lines
Cursor right Expandable lines - if file or directory is defined for them, view directory or file
Cursor left Go to the parent, collapsing the current item if it is expanded

Configuration file format

The configuration file consists of variable length records, semi-colon delimited.

Field number Description Values Meaning
1 Line type + - / \ . # # = comment line
+ = expandable - all following "-" and "/" records are members
- = subsidiary to + record
{ = start of nested expandable record
} = end nested record set (no other fields in record)
. = title/name pair (top level)
2 Display title Title to be shown (not line type "\")
3 File type D F B D = directory (view with filemanager)
F = text file (view with fileview)
B = binary file (view with hexview)
Optional for "+" and "/" line types, not present for line type "\"
4 File name Absolute name of target - can be an environment variable. Optional for "+" and "/" line types, not present for line type "\"

Example:

# fileindex default config file
# Config file format:
# Variable length records, semi-colon delimited
# Fields:
# 1)  Line type
#     Values +,-,{,},.,#
#     + = expandable - all following "-" records are members
#     - = subsidiary to + record
#     { = nested expandable record
#     } = end nested record set (no other fields in record)
#     . = title/name pair (top level)
#     # = comment line
# 2)  Title to be displayed
# 3)  File type (can be omitted for + and { lines)
#     Values D/F/B
#     D = directory (view with filemanager)
#     F = text file (view with fileview)
#     B = binary file (view with hexview)
# 4)  File name (can be omitted for + and { lines)
#     Absolute name of target - can be environment variable
#
# Expandable entry with two subsidiary entries
+;Main development dirs
-;Nimrod dev;D;/nimroddev
-;Apollo dev;D;/apollodev
#
# Expandable entry with two subsidiary entries
+;Main dirs
-;Nimrod;D;/nimrod
-;Apollo;D;/apollo
#
# Expandable entry with two subsidiary entries
+;Config dirs
-;Nimrod config;D;/nimrod/config
-;Apollo config;D;/apollo/config
#
# Two top-level entries
.;System maintenance logs;D;/sysmaint/logs
.;System log /var/adm/syslog.log;F;/var/adm/syslog.log
#
# Expandable entry with nesting to two levels
+;Apollo regions
{;BCV
{;North (main dir);D;/apollo/bcv-ltnorth-apollo
-;Config dir;D;/apollo/bcv-ltnorth-apollo/config
-;Log dir;D;/apollo/bcv-ltnorth-apollo/logs
-;Data dir;D;/apollo/bcv-ltnorth-apollo/sapdata
-;Transfer dir;D;/apollo/bcv-ltnorth-apollo/saptran
}
{;Central (main dir);D;/apollo/bcv-ltcentral-apollo
-;Config dir;D;/apollo/bcv-ltcentral-apollo/config
-;Log dir;D;/apollo/bcv-ltcentral-apollo/logs
-;Data dir;D;/apollo/bcv-ltcentral-apollo/sapdata
-;Transfer dir;D;/apollo/bcv-ltcentral-apollo/saptran
}
{;South (main dir);D;/apollo/bcv-ltsouth-apollo
-;Config dir;D;/apollo/bcv-ltsouth-apollo/config
-;Log dir;D;/apollo/bcv-ltsouth-apollo/logs
-;Data dir;D;/apollo/bcv-ltsouth-apollo/sapdata
-;Transfer dir;D;/apollo/bcv-ltsouth-apollo/saptran
}
}
{;DEV
{;North (main dir);D;/apollo/bcv-ltnorth-apollo
-;Config dir;D;/apollo/bcv-ltnorth-apollo/config
-;Log dir;D;/apollo/bcv-ltnorth-apollo/logs
-;Data dir;D;/apollo/bcv-ltnorth-apollo/sapdata
-;Transfer dir;D;/apollo/bcv-ltnorth-apollo/saptran
}
{;Central (main dir);D;/apollo/bcv-ltcentral-apollo
-;Config dir;D;/apollo/bcv-ltcentral-apollo/config
-;Log dir;D;/apollo/bcv-ltcentral-apollo/logs
-;Data dir;D;/apollo/bcv-ltcentral-apollo/sapdata
-;Transfer dir;D;/apollo/bcv-ltcentral-apollo/saptran
}
{;South (main dir);D;/apollo/bcv-ltsouth-apollo
-;Config dir;D;/apollo/bcv-ltsouth-apollo/config
-;Log dir;D;/apollo/bcv-ltsouth-apollo/logs
-;Data dir;D;/apollo/bcv-ltsouth-apollo/sapdata
-;Transfer dir;D;/apollo/bcv-ltsouth-apollo/saptran
}
}

Script

COBOL source