Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

openFile

Open a File with an Associated Program


Description

Open a file using the program that the operating system (Windows/Mac OS X/Linux) associates with its type. Users wishing to override the default application can specify a program association using setPBSext.

Usage

openFile(fname, package=NULL)

Arguments

fname

character vector, containing file names to open.

package

(optional) open files relative to this package.

Value

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

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, Vancouver Island University, Nanaimo BC

See Also

Examples

## Not run: 
local(envir=.PBSmodEnv,expr={
  # use openFile directly:
  openFile( "doc/PBSmodelling-UG.pdf", package="PBSmodelling" )
})
local(envir=.PBSmodEnv,expr={
  # via doAction in a window description file:
  createWin( "button text=help func=doAction width=20 pady=25 bg=green
  action=\"openFile(`doc/PBSmodelling-UG.pdf`,package=`PBSmodelling`)\"", astext=TRUE)
})
local(envir=.PBSmodEnv,expr={
  # Set up Firefox to open .html files (only applicable if Firefox is NOT default web browser)
  setPBSext("html", '"c:/Program Files/Mozilla Firefox/firefox.exe" file://%f')
  openFile("foo.html")
})

## End(Not run)

PBSmodelling

GUI Tools Made Easy: Interact with Models and Explore Data

v2.68.8
GPL (>= 2)
Authors
Jon T. Schnute [aut], Alex Couture-Beil [aut], Rowan Haigh [aut, cre], Nicholas Boers [ctb], Anisa Egeli [ctb], A. R. Kronlund [ctb], Steve Martell [ctb], Norm Olsen [ctb]
Initial release
2019-03-12

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.