Skip to contents

Test if an entry (file or directory) exists on a virtual ADF device. adf_file_exists() is the equivalent of file.exists() on a virtual ADF device. adf_dir_exists() is the equivalent of dir.exists() on a virtual ADF device.

Usage

adf_file_exists(x, virtual_path, ...)

# S3 method for class 'adf_device'
adf_file_exists(x, virtual_path, ...)

# S3 method for class 'virtual_path'
adf_file_exists(x, virtual_path, ...)

adf_dir_exists(x, virtual_path, ...)

# S3 method for class 'adf_device'
adf_dir_exists(x, virtual_path, ...)

# S3 method for class 'virtual_path'
adf_dir_exists(x, virtual_path, ...)

Arguments

x

Either a virtual device or virtual path.

virtual_path

A virtual_path() to be checked for existence. Should be omitted when x is already a virtual path.

...

Ignored

Value

adf_file_exists() returns TRUE if the path exists on the virtual device, FALSE otherwise. adf_dir_exists() returns TRUE when the path exists and is a directory, FALSE otherwise.

Author

Pepijn de Vries

Examples

## First setup a connection to a virtual device
adz_file <- system.file("example.adz", package = "adfExplorer2")
my_device <- connect_adf(adz_file)

adf_file_exists(my_device, "s/startup-sequence")
#> [1] TRUE
adf_dir_exists(my_device, "s/startup-sequence")
#> [1] FALSE

close(my_device)