openProjFiles {PBSmodelling}R Documentation

Open Files with a Common Prefix

Description

Open one or more files from the working directory, given one file prefix and one or more file suffixes.

Usage

openProjFiles(prefix, suffix, package=NULL, warn=NULL, alert=TRUE)

Arguments

prefix a single prefix to prepend to each suffix
suffix a character vector of suffixes to append to the prefix
package name of the package that contains templates, or NULL to not use templates
warn if specified, use to temporarily override the current R warn option during this function's activity; if NULL, the current warning settings are used.
alert if TRUE, an alert message is shown should any files fail to be opened;
if FALSE, no alert is displayed.

Details

The suffixes may contain wildcards ("*" to match 0 or more characters, "?" to match any single character).

For any file that does not exist in the working directory, a template can optionally be copied from a directory named templates in the specified package. The templates in this directory should have the prefix template, followed by the suffix to match when openProjFiles is called (e.g., template.c to match the suffix .c. After being copied to the working directory, the new file is renamed to use the specified prefix.

To use this function in a window description file, the package and suffix arguments must be specified as the action of the widget that calls openProjFiles. Furthermore, package and each suffix must be separated by commas. For example, action=myPackage,.r,.c will try to open a .r and .c file in the working directory, copying templates from the template directory for the package myPackage, if the files didn't already exist. To disable templates, leave package unspecified but keep the leading comma (e.g., action=,.r,.c). When the function is called from a widget in this fashion, the prefix is taken from the value of a widget named prefix.

Note

If all the required arguments are missing, it is assumed that the function is being called by a GUI widget.

See Also

openFile, setPBSext, openExamples, openPackageFile

Examples

## Not run: 
openProjFiles("foo", c(".r", ".c"), package="myPackage")
## End(Not run)

[Package PBSmodelling version 2.06 Index]