director_exists: Determine whether a resource exists relative to a director...

Description Usage Arguments Value Examples

Description

Determine whether a resource exists relative to a director object.

Usage

1

Arguments

resource

character. The name of the resource.

helper

logical. Whether or not to check helper existence in an idempotent resource. The default is FALSE.

Value

TRUE or FALSE according as it does or does not exist.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
## Not run: 
  # Imagine we have a file structure:
  #   - foo
  #     - one
  #       - one.R
  #       - helper.R
  #     - two.R
  #
  # Then the bellow will return \code{TRUE}, \code{FALSE}, and \code{TRUE},
  # respectively. Note that the \code{"helper.R"} file is not considered a
  # resource by the director as \code{"one.R"} shares its name with its
  # parent directory and is considered the accessible resource.

  d <- director('foo')
  d$exists('one')
  d$exists('one/helper')
  d$exists('two')

## End(Not run)

syberia/director documentation built on May 30, 2019, 10:40 p.m.