openFile {PBSmodelling}R Documentation

Open a File with an Associated Program

Description

Open a file using the program associated with its extension defined by the Windows shell. Non-windows users, or users wishing to overide the default application, can specify a program association using setPBSext.

Usage

openFile(fname, package=NULL)

Arguments

fname name(s) of file(s) to open.
package (optional) open files relative to this package

Value

An invisible string vector of the file names and/or commands + file names.

Warning

Windows only: openFile( ".." ) does not work as expected, but openFile( "../.." ) only opens the first parent directory.

Note

If a command is registered with setPBSext, then openFile will replace all occurrences of "%f" with the absolute path of the filename, before executing the command.

Author(s)

Alex Couture-Beil, Malaspina University-College, Nanaimo BC

See Also

getPBSext, setPBSext, clearPBSext, writePBSoptions

Examples

## Not run: 

#use openFile directly:
openFile( "doc/PBSmodelling-UG.pdf", package="PBSmodelling" )

#via doAction in a window description file:
createWin( "button text=help func=doAction action=\"openFile( `doc/PBSmodelling-UG.pdf`, package=`PBSmodelling` )\"", astext=TRUE )

#############################
# Set up firefox to open .html files (only applicable if firefox is NOT the default web browser
setPBSext("html", '"c:/Program Files/Mozilla Firefox/firefox.exe" file://%f')
openFile("foo.html")
## End(Not run)

[Package PBSmodelling version 2.55.175 Index]