Get an overview of all entries (files and directories) in a specific directory.
Usage
list_adf_entries(x, path, recursive = FALSE, nested = FALSE, ...)
# S3 method for class 'adf_device'
list_adf_entries(x, path, recursive = FALSE, nested = FALSE, ...)
# S3 method for class 'virtual_path'
list_adf_entries(x, path, recursive = FALSE, nested = FALSE, ...)
# S3 method for class 'character'
list_adf_entries.adf_device(x, path, recursive = FALSE, nested = FALSE, ...)
# S3 method for class 'virtual_path'
list_adf_entries.adf_device(x, path, recursive = FALSE, ...)
Arguments
- x
Either an
adf_device
class object, in which case thevirtual_path
argument needs to be specified; or, avirtual_path
class object.- path
The virtual path for which you wish to obtain a list of entries (see also
vignette("virtual_paths")
). When missing, entries for the current directory (adf_directory()
) are returned, wenx
is anadf_device
class object. Ifx
is avirtual_path
class object, content of the path defined in that object is listed- recursive
A
logical
value. When set toTRUE
, the function is called recursively for all subdirectories inpath
.- nested
A
logical
value. When set to The directory tree is returned as a nested list.- ...
Ignored
Examples
## First setup a connection to a virtual device
my_device <- demo_adf()
## List all entries in the disk's root:
list_adf_entries(my_device)
#> DIR DEWR... Devs
#> DIR DEWR... S
#> DIR DEWR... this
#> DIR DEWR... mods
## List all entries on the disk as a vector of `virtual paths`:
list_adf_entries(my_device, recursive = TRUE)
#> DIR DEWR... Devs
#> FILE DEWR...iguration
#> DIR DEWR... S
#> FILE DEWR...-Sequence
#> DIR DEWR... this
#> DIR DEWR... is
#> DIR DEWR... a
#> DIR DEWR... deep
#> DIR DEWR... path
#> DIR DEWR... mods
#> FILE DEWR...mod.intro
## List all entries on the disk as a nested list:
list_adf_entries(my_device, recursive = TRUE, nested = TRUE)
#> $Devs
#> $Devs$`system-configuration`
#> NULL
#>
#>
#> $S
#> $S$`Startup-Sequence`
#> NULL
#>
#>
#> $this
#> $this$is
#> $this$is$a
#> $this$is$a$deep
#> $this$is$a$deep$path
#> list()
#>
#>
#>
#>
#>
#> $mods
#> $mods$mod.intro
#> NULL
#>
#>
close(my_device)