# File Request Configuration

## General

Main settings of File Requests service.

This string grid is designed to specify directories with files that may be requested within file transfer sessions (file base). It is possible to protect files of a particular directory with a password so a requesting system must send the same password whenever it requests a file from that directory. Please note that passwords are passing to remote in non-secure manner as a cleartext. Password comparing is case-sensitive.

- Disable all requests - all file requests are denied if the box is ticked. `NRQ` flag will be sent by Argus in EMSI packet to advise a calling system not to send `REQ` files.
- Recursive paths - search for files recursively in all sub-directories of directories specified in the ‹Requested directories› grid. The depth of recursion is not limited.
- Allow masks - allow file requests with Wildcards and Regular Expressions. For example, a user may request `*.jpg` to receive all JPEG files from directories, specified in the ‹Requested directories› grid. Complex masks (e.g. `DOOM*2_%.*`) are also supported. Besides ‹`*`› and ‹`?`›, there is a support of ‹`%`› mask character, that allows any digit on its position.
- Real-time search - search for files during file transfer session. If it is off, Argus builds and index file for requestable files and gets the information from there - it is faster for large file bases, but it requires re-compilation of the index file each time the file base is updated.

## Aliases

Argus allows callers to request files using Aliases (also called magic names), a caller does not need to know the real name of files requested. For example, FidoNet Nodelist is requestable from most FidoNet nodes as `NODELIST` while the real name of the Nodelist file is changing every week. Another example is the file list of a system, which is often requested using the Alias `FILES`.

Aliases are defined in Aliases string grid; Path column contains full path names of files to be sent for a particular Alias request, divided with a comma, space or semicolon; The Password column contains an optional password for each Alias entry. Password comparing is case-sensitive.

Wildcards and Regular Expressions are also allowed in Aliases string grid. The rules of using wildcards are the same as for Allow Masks checkbox of General tab (see above). When using wildcards, you may also specify ‹`>`› prefix before the file name. It will select the only newest (by modification date) file from the masked list. Wildcards and Regular Expressions in Path column are only allowed in name section, not in path section. E.g. `c:\games\*.*` is valid in but `c:\games\*\readme.txt` is invalid.

Example of Aliases string grid with NODEDIFF alias for the latest nodediff.

Alias | Path
    NODEDIFF
    >R:\AF\NODELIST\NODEDIFF.Z%%

## External Request Processing (SRIF)

Argus has an external file request processing support using SRIF (Standard Request Information File), developed by Gordian Schuermann & Mirko Mucko.

External request processing is enabled or disabled using option Use SRIF. When this option is set, all other options above mentioned in this chapter are disabled, and all file requests are processed by the External Request Processor (ERP), not by Argus. The objective of SRIF method is to pass as a command line argument to ERP the name of temporary SRIF-file (which is created and erased after it is used, by Argus), containing all necessary information about files being requested.

The ERP file name and command line parameters are configured in Standard Request Information File - External Processor field. Special keyword `%SRIF%`, used only in this field, is being replaced to the name of temporary SRIF-file

This is an example of using AllFix © Harms Software Eng. as an ERP:

`c:\fido\allfix\allfix.exe Rp -SRIF %SRIF%`

Question Mark character (“`?`”) before file name instructs to execute the process in hidden mode. Exclamation Mark character (“`!`”) instructs to execute the process in normal window mode. Detached mode can be used only for launching Win32 console applications. Double Question Mark (“`??`”) instructs to execute the process in DETACHED mode (without using console window) . An attempt to execute DETACHED Win3.1 or DOS application causes an error.

Processes can be launched with the following priority levels:

    <
| Low (`IDLE_PRIORITY_CLASS`)
    +
| High (`HIGH_PRIORITY_CLASS`)
    *
| Real-time (`REALTIME_PRIORITY_CLASS`)

Processes are executing with normal priority (`NORMAL_PRIORITY_CLASS`) in minimised window by default.

## Service Requests

The Service Request concept is is very similar to the SRIF ERP (described above). In both cases, an external application is used to serve file requests. Unlike SRIF, when one application is launched to serve a whole batch of requested file, Service Requests allow to run a particular application for each requested item. Service Requests cannot coexist with SRIF. To user Service Requests turn "Use SRIF" checkbox off. Service Requests are typically used to invoke programs that update databases, or sends specific files only after checking a database for specific information (product updates for example).

Service Requests are defined in the file request alias list (Aliases string grid) by placing an equal sign ('`=`') as a first character in "Path" column . E.g.

Alias |  | Path
`PRODUCTUPDATE` |  | `=C:\SR\PRODUPD.EXE ^<symbol><filemask>`

where `C:\SR\PRODUPD.EXE` is the program to execute, `^<symbol>` defines what Argus should do with the files matching `<filemask>` after the session has been completed. Wildcards and Regular Expressions in `<filemask>` are only allowed in name section, not in path section. E.g. `c:\games\*.*` is valid in but `c:\games\*\readme.txt` is invalid.

`^` character and `<filemask>` are mandatory, `<symbol>` is optional. If no `<symbol>` is specified, the Mailer assumes that all files matching `<filemask>` should be removed after the session has been completed regardless of the transmission status of each file.

Priority modifiers for Low, High and Real-Time priority classes as well as window mode (normal/detached/hidden) can be specified same way as for SRIF.

Executable path/file name, parameters and filemask may contain special handshake switches (also called macros, same as Handshake Switches for Doors and External Polls) that are translated into appropriate string values before the application is started. Each command switch starts with the percent symbol followed by a command character. All handshake command line switches are case sensitive, for example `%c` may not be used instead of `%C`.

For each possible handshake switch an Environment variable is also created, which could be used by launched application. Even if no hadshake switches are specified in executable path/file name and parameters, all Environment variables are created.

The following switches return caller's information.

| Environment | Description
    %w
    ARGUS_NODE
| Primary node address, eg "2:469/38"
    %x
    ARGUS_STATION
| Station name.
    %v
    ARGUS_LOCATION
| Site location.
    %X
    ARGUS_SYSOP
| Sysop's name.

The following switches return line and connection information and vary for dial-up and TCP/IP connection.

| Environment | Description | Dial-up value | TCP/IP value
    %B

    ARGUS_DCE
| Connect speed | DCE (modem to modem) | as assumed in TCP/IP Daemon configuration dialogue box
    %b

    ARGUS_DTE
| Port speed | DTE (computer to modem) | same as `%B`
    %e

    ARGUS_CONNECT
| Connect string (spaces replaced to underlines) | as returned after modem CONNECT word, e.g.: "`16800/ARQ/HST`” | as returned after Argus TCP/IP CONNECT word, e.g.: "`To 194.213.233.33 #24554`”]
    %E

    ARGUS_CONTROL
| Translated error control code | "`MNP`" if any of MNP, ARQ or REL string is present in the connect string. Otherwise null. | Always "`TCP/IP`"
    %L

    ARGUS_NAME
| Mailer line name (spaces replaced to underlines) | as in dial-up/lines/line name | "TCP/IP" plus number of TCP/IP connections, e.g.: "`TCP/IP 3`"
    %n

    ARGUS_LINE
| Mailer line number | Number of entry in dial-up/lines list, e.g. "`1`" for the first line listed. | Number of active TCP/IP connection, e.g. "`2`" for "TCP/IP 2" line
    %h

    ARGUS_HANDLE
| Communication resource handle | COM port Win32 handle | WinSock2 overlapped socket handle
    %C

    ARGUS_NUMBER
| Port number | COM port number, e.g.: "`1`" for COM1 or "`4`" for COM4 | TCP/IP port number, e.g.: `24554` for BinkD
    %p

    ARGUS_INDEX
| Port index | zero-based COM port number, e.g.: "`0`" for COM1 or "`3`" for COM4 | same as `%C`

Special `%Z` switch is also allowed here and works same way as in Doors.