With these functions you can copy or move entries (files and directories) between
a physical and virtual ADF device. With copy_adf_entry()
the files are duplicated,
with move_adf_entry()
the files are moved (and deleted from its source).
Usage
copy_adf_entry(source, destination, ...)
# S3 method for class 'character'
copy_adf_entry(source, destination, ...)
# S3 method for class 'virtual_path'
copy_adf_entry(source, destination, ...)
# S3 method for class 'virtual_path'
copy_adf_entry.character(source, destination, ...)
# S3 method for class 'virtual_path'
copy_adf_entry.virtual_path(source, destination, ...)
# S3 method for class 'character'
copy_adf_entry.virtual_path(source, destination, ...)
move_adf_entry(source, destination, ...)
# S3 method for class 'character'
move_adf_entry(source, destination, ...)
# S3 method for class 'virtual_path'
move_adf_entry(source, destination, ...)
# S3 method for class 'virtual_path'
move_adf_entry.character(source, destination, ...)
# S3 method for class 'virtual_path'
move_adf_entry.virtual_path(source, destination, ...)
# S3 method for class 'character'
move_adf_entry.virtual_path(source, destination, ...)
Arguments
- source, destination
The
source
is a path to a file or directory that needs to be moved or copied.destination
is a path to a directory to which thesource
needs to be copied or moved. Whensource
ordestination
is acharacter
string, it is assumed to be a path to a file or directory on a physical device. You can use avirtual_path()
for either thesource
ordestination
or both.source
anddestination
cannot both be acharacter
string. For copying and moving files on a physical device you should youbase
functionfile.copy()
.- ...
Ignored
Examples
## Create an Amiga Disk File
## and prepare a file system on the virtual device
my_device <-
create_adf_device(
tempfile(fileext = ".adf"),
write_protected = FALSE) |>
prepare_adf_device()
## Copy the packaged R scripts of this package to the virtual device
copy_adf_entry(
system.file("R", package = "adfExplorer2"),
virtual_path(my_device, "DF0:")
)
## List all entries on the virtual device
list_adf_entries(my_device, recursive = TRUE)
#> DIR DEWR... R
#> FILE DEWR...orer2.rdb
#> FILE DEWR...orer2.rdx
#> FILE DEWR...Explorer2
## Move the entire virtual device content to
## the tempdir on your physical device
move_adf_entry(
virtual_path(my_device, "DF0:"),
tempdir()
)
close(my_device)