name: Obtain or modify an entry name on a virtual device

adf_entry_name<-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 virtual_path() pointing to the targeted entry (file or directory). Should be omitted when x is already a virtual path.

...

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

## Open virtual device to demonstrate methods
my_device <- demo_adf(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)

adfExplorer documentation built on April 3, 2025, 7:45 p.m.