findPrefix {PBSmodelling}R Documentation

Find a Prefix Based on Names of Existing Files

Description

Find the prefixes of files with a given suffix in the working directory.

Usage

findPrefix(suffix)

Arguments

suffix character vector of suffixes

Details

The function findPrefix locates all files in the working directory that end with one of the provided suffixes. The suffixes may contain wildcards ("*" to match 0 or more characters, "?" to match any single character).

If findPrefix was called from a widget as specified in a window description file, then the value of a widget named prefix will be set to the prefix of the first matching file found, with an exception: if the value of the prefix widget matches one of the file prefixes found, it will not be changed.

To use this function in a window description file, the action of the widget is used to specify the suffixes to match, with the suffixes separated by commas. For example, action=.c,.cpp would set a prefix widget to the first file found with an extension .c or .cpp.

Value

A character vector of all the prefixes of files in the working directory that matched to one of the given suffixes.

See Also

setwdGUI

Examples

## Not run: 
# Match files that end with '.a' followed by 0 or more characters,
# '.b' followed by any single character, '.c', or '-old.d'
# (a suffix does not have to be a file extension)
findPrefix(".a*", ".b?", ".c", "-old.d")
## End(Not run)

[Package PBSmodelling version 2.06 Index]