Next: Opening a File and
Up: Files
Previous: Files
The procedures mred:get-file and mred:put-file
query the user for a filename; mred:get-file gets the name of an
existing file, and mred:put-file gets the name for a new file.
By default, mred:get-file and mred:put-file are
bound to mred:std-get-file and mred:std-put-file,
which implements the filename query using platform-specific dialogs.
Platform-independent dialogs are available through
mred:common-get-file and mred:common-put-file,
which take the same arguments as their std counterparts.
- (mred:std-get-file directory prompt filter filter-msg parent) -- All parameters are optional.
The dialog starts the user in the directory specified by
directory. By default, directory is '() so that
a starting directory is picked automatically. The prompt
parameter is a string prompt for the user. The filter argument
is a regular expression (a string or a regexp value); if filter
is provided only filenames that match the filter can be supplied by
the user. If filter is provided an the user selects a name that
does not match the regular expression, then the message string
filter-msg is displayed. The parent is a parent window.
- (mred:std-put-file name directory replace? prompt filter filter-msg parent) --
All parameters are optional.
The dialog uses name as a suggested file name; the default is
``Untitled''. If name includes a directory path and
directory is '() (the default), then name's
directory will be used. If
replace? is #f (the default), then the user will be warned
about selecting the name of an existing file. The
filter, filter-msg, and parent arguments are as in mred:std-get-file.
The mred:common-get-file and mred:common-put-file
dialogs keep a separate directory state (for starting in the
same place as the previous dialog ended); this directory can be
obtained with
(mred:current-find-file-directory) or set to s directory
dir with (mred:current-find-file-directory dir).
The procedure mred:common-get-file-list gets a list of
filenames from the user using a platform-independent dialog. The
arguments are the same as for mred:get-file and the
result is either #f or a list of filenames.
All filenames returned by these procedures are normalized using
mzlib's normalize-path.
Next: Opening a File and
Up: Files
Previous: Files
PLT