folder(1mh)
Name
folder − set folder or display current foldername
Syntax
folder [+foldername] [msg] [−all] [−fast] [−nofast] [−header] [−noheader] [−pack] [−nopack] [−recurse] [−norecurse] [−total] [−nototal] [−print] [−noprint] [−list] [−nolist] [−push] [−pop] [−help]
Description
The folder command lets you set the current folder or display its name and its contents. It can also be used to manage the folder stack. If you use the folder command without a +foldername argument, the contents of the current folder will be displayed on the screen.
If you use folder with the +foldername argument, the specified folder will be set to be the current folder.
If you use folder with the msg argument, it will set the specified message to be current.
The display is identical whether you set the folder or display the contents of the current folder. The following example shows the type of display that is produced. The display lists the current folder, the number of messages in it, the range of the messages (low−high), and the current message within the folder, and will flag extra files if they exist.
inbox+has 16 messages( 3− 22); cur= 15
If a +foldername and/or msg argument are specified, they will become the current folder and/or message.
Options
Specifying −all will produce a line for each folder in your MH directory, sorted alphabetically. This is identical to the effect that is obtained if you specify folders. The display that is obtained is illustrated in the following example.
Folder # of messages (range); cur msg (other files)
V2.3 has 3 messages (1-3).
adrian has 20 messages (1-20); cur= 2.
brian has 16 messages (1-16).
chris has 12 messages (1-12).
copylog has 242 messages (1- 242); cur= 225.
inbox+ has 73 messages (1- 127); cur= 127.
int has 4 messages (1-4); cur= 2 (others).
jack has 17 messages (1-17); cur= 17.
TOTAL= 387 messages in 8 folders.
The plus sign (+) after inbox indicates that it is the current folder. The folder int has (others) after the description of the folder. This indicates that the folder int contains files which are not messages. These files may either be sub-folders, or files that do not belong under the MH file naming scheme.
You can get the same effect by specifying folders instead of folder−all (see folders(.)).)
The header is output if either an −all or a −header switch is specified. It is suppressed by −noheader. The −total switch will produce only the summary line. If you select the −nototal option, the summary line will be suppressed but the rest of the information about the folders will be displayed.
If −fast is given, only the folder name will be listed. This is faster because the folders need not be read.
The −pack switch will compress the message names in a folder, removing holes in message numbering.
The −recurse switch will list each folder recursively. Use of this option effectively defeats the speed enhancement of the −fast option, since each folder must be searched for subfolders. Nevertheless, the combination of these options is useful.
If you specify a +folder that does not exist, you will be asked whether you want to create it. This is a good way to create an empty folder for later use. The following example shows how you can create a sub folder in the folder +test using this method.
% folder +test/testtwo
Create folder "/usr/username/Mail/test/testwo"? y
test/testtwo+ has no messages.
See refile() for more details of sub folders.
The −push, −pop, and - options can be used to manage the folder stack.
The −push switch directs folder to push the current folder onto the folder-stack, and make the +folder argument into the current folder. If +folder is not given, the current folder and the top of the folder-stack are exchanged. This corresponds to the pushd operation in the Cshell (see csh().)).
The −pop switch directs folder to discard the top of the folder-stack, after setting the current folder to that value. No +folder argument is allowed. This corresponds to the popd operation in the Cshell (see csh())) The −push switch and the −pop switch are mutually exclusive: the last occurrence of either one overrides any previous occurrence of the other.
The −list switch directs folder to list the contents of the folder-stack. No +folder argument is allowed. After a successful −push or −pop, the −list action is taken. This corresponds to the dirs operation in the Cshell. The defaults for folder are:
+foldername defaults to the current folder
msg defaults to none
−nofast
−noheader
−nototal
−nopack
−norecurse
−print is the default if −list, −push or −pop are specified.
Files
| $HOME/.mh_profile | The user profile |
Profile Components
| Path: | To determine your MH directory |
| Current−Folder: | To find the default current folder |
| Folder−Protect: | To set mode when creating a new folder |
| Folder−Stack: | To determine the folder stack |
| lsproc: | Program to list the contents of a folder |