PBSmodelling (version 2.69.3)

setPBSext: Set Command to Associate with File Name Extension

Description

Set a command with an associated extension, for use in openFile. The command must specify where the target file name is inserted by indicating a '%f'.

Usage

setPBSext(ext, cmd)

Arguments

ext

character -- string specifying the extension suffix.

cmd

character -- command string to associate with the extension.

Author

Alex Couture-Beil, Software Engineer
Earthly Technologies, Victoria BC

Maintainer: Rowan Haigh, Program Head -- Offshore Rockfish
Pacific Biological Station (PBS), Fisheries & Oceans Canada (DFO), Nanaimo BC
locus opus: Regional Headquarters (RHQ), Vancouver BC
Last modified Rd: 2023-01-05

See Also

In package PBSmodelling:
getPBSext, openFile, clearPBSext

Examples

Run this code
if (FALSE) {
local(envir=.PBSmodEnv,expr={
  ## Set '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")

  ## Set 'notepad' to open '.txt' files (only applicable if notepad is NOT default editor)
  ## Note that commands to editors (at least in Windows) do not use 'file://'.
  setPBSext('txt', '"C:/Windows/notepad.exe" %f')
  openFile("foo.txt")
})
}

Run the code above in your browser using DataLab