adf_entry_name<- {adfExplorer} | R Documentation |
Obtain or modify an entry name on a virtual device
Description
Get the name of an entry (root, file or directory) or update it with the
assign operator (<-
).
Usage
adf_entry_name(x, path, ...) <- value
adf_entry_name(x, path, ...)
## S3 replacement method for class 'adf_file_con'
adf_entry_name(x, path, ...) <- value
## S3 replacement method for class 'adf_device'
adf_entry_name(x, path, ...) <- value
## S3 replacement method for class 'virtual_path'
adf_entry_name(x, path, ...) <- value
## S3 replacement method for class 'adf_device.character'
adf_entry_name(x, path, ...) <- value
## S3 replacement method for class 'adf_device.virtual_path'
adf_entry_name(x, path, ...) <- value
Arguments
x |
Either a virtual device or virtual path. |
path |
A |
... |
Ignored |
value |
New name for the entry. The name will be sanitised and truncated before it is assigned to the entry. |
Value
Returns the entry name of the requested path or in case of an assign
operation (<-
) an updated version of x
.
Author(s)
Pepijn de Vries
Examples
## ADZ files can only be opened in 'write protected' mode
## extract it to a temporary file to allow writing to the virtual disk
adf_file <- tempfile(fileext = ".adf")
decompress_adz(
system.file("example.adz", package = "adfExplorer"),
adf_file)
## Open virtual device to demonstrate methods
my_device <- connect_adf(adf_file, write_protected = FALSE)
## rename a specific entry
adf_entry_name(my_device, "DF0:mods/mod.intro") <- "mod.music"
## rename disk (also possible with `volume_name<-()`)
adf_entry_name(my_device, "DF0:") <- "my_disk"
close(my_device)
[Package adfExplorer version 2.0.0 Index]