Home Page The Club Computers News Links Glossary EYAWTK
Before Amiga Background ICS OCS ECS AGA ??? PPC
U-Boot SLB Linux Amiga OS Dual Boot Motherboards Peripherals Other
Initialisation Installation OS4 Updates About OS4 File Systems Networking Printing Other
Introduction File System Workbench Preferences Commands Error Msgs Miscellaneous

AmigaOS 4.0 - About OS4 - Commands

REQUESTFILE AmigaDOS
Purpose: Allows AmigaDOS and ARexx scripts to use a file requester.
Format: REQUESTFILE [DRAWER <drawer name>] [FILE <file name>] [PATTERN <pattern>] [TITLE <title>] [POSITIVE <text>] [NEGATIVE <text>] [ACCEPTPATTERN <pattern>] [REJECTPATTERN <pattern>] [SAVEMODE] [MULTISELECT] [DRAWERSONLY] [NOICONS] [TO <variable name>] [PUBSCREEN <public screen name>]
Template: DRAWER, FILE/K, PATTERN/K, TITLE/K, POSITIVE/K, NEGATIVE/K, ACCEPTPATTERN/K, REJECTPATTERN/K, SAVEMODE/S, MULTISELECT/S, DRAWERSONLY/S, NOICONS/S, TO/K, PUBSCREEN/K
Path: C:REQUESTFILE
When REQUESTFILE is executed with no arguments, a file requester with OK, Volumes, Parent, and Cancel buttons is created. The Drawer and File gadgets are empty and it displays the contents of the current directory, as shown below:

The DRAWER argument specifies the initial contents of the Drawer gadget.

The FILE option specifies the initial contents of the File gadget.

The PATTERN option allows the use of a standard AmigaDOS pattern. It includes a Pattern gadget in the requester and specifies the initial contents of the gadget. If this option is not provided, the file requester does not have any Pattern gadget.

The TITLE option specifies the title of the requester.

The POSITIVE option specifies the text to appear in the positive (left) choice in the file requester.

The NEGATIVE option specifies the text to appear in the negative (right) choice in the file requester.

The ACCEPTPATTERN option specifies a standard AmigaDOS pattern. Only files matching this pattern are displayed in the file requester.

The REJECTPATTERN option specifies a standard AmigaDOS pattern. Files matching this pattern are not displayed in the file requester.

If the SAVEMODE option is specified, the requester is used for writing files to disk.

If the MULTISELECT option is specified, the requester allows multiple files to be selected at once.

If the DRAWERSONLY option is specified, the requester does not have a File gadget. This effectively turns the file requester into a directory requester.

If the NOICONS option is specified, the requester does not display icons (.info files).

The PUBSCREEN argument allows the requester to open its window on a public screen.

The selected files are printed as a result to the console, enclosed in double quotation marks and separated with spaces. For evaluation by a script file, the TO argument can be used to specify an environment variable that the output is redirected to. The command generates a return code of 0 if you select a file or 5 if you cancel the requester.

Example 1:

    3.OS4:> REQUESTFILE DRAWER Devs: TITLE "My Requester" NOICONS

displays the following requester:

If "ahi.device" was selected and OK was clicked, the following would be displayed on the console:

    "ahi.device"

On the other hand, if Cancel was clicked, the following would be displayed on the console:

    ***Break

Example 2:

    3.OS4:> REQUESTFILE TITLE "Resources" DRAWERSONLY TO=ENV:res

displays the following requester:

If "Miscellaneous" was selected and OK was clicked, nothing would be displayed on the console, but ENV:res would contain the respective value, i.e.

    3.OS4:> GETENV res
    "Miscellaneous/"

The script can use this value to control its subsequent execution. On the other hand, if Cancel was clicked, the following would be displayed on the console:

    ***Break

and ENV:res would still contain the same value it had prior to displaying the requester.

See also: REQUESTCHOICE, REQUESTSTRING.


Return to Commands Selection

Disclaimer: Amiga Auckland have prepared the above information for the use of its members based on our experiences and as such is subject to revision at any time. Amiga Auckland cannot guarantee any of the information and cannot be held accountable for any issues that may result from using it.


Copyright 2006 Amiga Auckland Inc. All rights reserved.
Revised: February 9, 2006.