Skip to contents

Put a file onto a virtual Amiga floppy disk represented by an amigaDisk object.

Usage

# S4 method for amigaDisk,raw,character,POSIXt,character
put.adf.file(x, source, destination, date, comment)

# S4 method for amigaDisk,raw,character,POSIXt,missing
put.adf.file(x, source, destination, date, comment)

# S4 method for amigaDisk,raw,character,missing,missing
put.adf.file(x, source, destination, date, comment)

# S4 method for amigaDisk,character,character,POSIXt,character
put.adf.file(x, source, destination, date, comment)

# S4 method for amigaDisk,character,character,POSIXt,missing
put.adf.file(x, source, destination, date, comment)

# S4 method for amigaDisk,character,character,missing,missing
put.adf.file(x, source, destination, date, comment)

# S4 method for amigaDisk,character,missing,missing,missing
put.adf.file(x, source, destination, date, comment)

Arguments

x

An amigaDisk onto which the file should be put.

source

Either a character string of the source file's path; or a vector of raw data that should be written to the destination file. Wildcards are not allowed (see details)

destination

A character string of the destination path on the virtual floppy disk where the source file should be put. The path should be conform Amiga specs (see current.adf.dir). When the destination is missing or only specifies a directory, the file will be put into the current directory (current.adf.dir) or specified path of x respectively. In that case, the same file name as that of the source file is used. Wild cards are not allowed (see details).

date

A POSIXt object that will be used as the file modification date. When missing the system time will used.

comment

An optional character string that will be included in the file header as a comment. Should not be longer than 79 characters.

Value

Returns an amigaDisk object onto which the source file is put at the specified destination.

Details

Put a file or raw data from your local system onto a virtual Amiga floppy disk represented by an amigaDisk object. Make sure that the virtual disk is DOS formatted. This method can only put one file at a time onto the virtual virtual disk. It is therefore not allowed to use wild cards in the source or destination names. Use loops to add multiple files onto a virtual disk.

Author

Pepijn de Vries

Examples

if (FALSE) {
## create a blank disk to put files onto:
blank.disk <- blank.amigaDOSDisk("blank", "DD", "OFS", TRUE, FALSE, FALSE)

## let's copy the base package 'INDEX' file onto the
## virtual disk:
blank.disk <- put.adf.file(blank.disk, system.file("INDEX"))

## We can also put raw data onto the virtual disk:
blank.disk <- put.adf.file(blank.disk, raw(2048), "DF0:null.dat")

## check whether we succeeded:
list.adf.files(blank.disk)
}