find_gs_cmd

0th

Percentile

Find a GhostScript Executable

Find a GhostScript executable in a cross-platform way.

Usage
find_gs_cmd(gs_cmd = "")
Arguments
gs_cmd
The name, full or partial path of a GhostScript executable.
Details

The details differ by platform.

On a Unix-alike, the GhostScript executable is usually called gs. The name (and possibly path) of the command is taken first from argument gs_cmd then from the environment variable R_GSCMD and default gs. This is then looked for on the system path and the value returned if a match is found.

On Windows, the name of the command is taken from argument gs_cmd then from the environment variables R_GSCMD and GSC. If neither of those produces a suitable command name, gswin64c and gswin32c are tried in turn. In all cases the command is looked for on the system PATH.

Note that on Windows (and some other OSes) there are separate GhostScript executables to display Postscript/PDF files and to manipulate them: this function looks for the latter.

Value

A character string giving the full path to a GhostScript executable if one was found, otherwise an empty string.

Aliases
  • find_gs_cmd
  • R_GSCMD
  • GSC
Documentation reproduced from package tools, version 3.2.0, License: Part of R 3.2.0

Community examples

Looks like there are no examples yet.