Shell resource client

Shell resource client

Format

A R6 object of class ShellResourceClient

Details

Executes local system shell commands.

Super classes

resourcer::ResourceClient -> resourcer::CommandResourceClient -> ShellResourceClient

Methods

Inherited methods


Method new()

Create a ShellResourceClient instance. This client will interact wtih a computation resource using shell commands.

Usage

ShellResourceClient$new(resource)

Arguments

resource

The computation resource.

Returns

The ShellResourceClient object.


Method getAllowedCommands()

Get the command names that can be executed.

Usage

ShellResourceClient$getAllowedCommands()

Returns

A character vector


Method copyFile()

Copy one or more files (wilcard * is supported in the file name (which can be a directory))

Usage

ShellResourceClient$copyFile(file, to = ".", verbose = FALSE)

Arguments

file

The file to copy.

to

The copy destination.

verbose

If TRUE, details the file operations on the console output.

Returns

The path to the files having been copied.


Method exec()

Executes a shell command in the working directory specified in the resource's URL.

Usage

ShellResourceClient$exec(command, params = NULL, test = FALSE)

Arguments

command

The command name.

params

A character vector of arguments to pass.

test

If TRUE, the command is printed but not executed (for debugging).

Returns

The command execution result object.


Method clone()

The objects of this class are cloneable with this method.

Usage

ShellResourceClient$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.