Skip to contents

Obtain file information of file from a virtual amigaDisk object.

Usage

# S4 method for amigaDisk,character
adf.file.info(x, path)

# S4 method for amigaDisk,character
adf.file.mode(x, path)

# S4 method for amigaDisk,character,character
adf.file.mode(x, path) <- value

# S4 method for amigaDisk,character,logical
adf.file.mode(x, path) <- value

# S4 method for amigaDisk,character,missing
adf.file.time(x, path, which)

# S4 method for amigaDisk,character,character
adf.file.time(x, path, which = c("m", "c", "a"))

# S4 method for amigaDisk,character,missing,POSIXt
adf.file.time(x, path, which) <- value

# S4 method for amigaDisk,character,character,POSIXt
adf.file.time(x, path, which = c("m", "c", "a")) <- value

# S4 method for amigaDisk,character
adf.file.size(x, path)

Arguments

x

An amigaDisk object in which this method will obtain file information.

path

A (vector of) character string(s) representing a file or directory name. Use Amiga specifications for file name (see current.adf.dir). Wildcards are not allowed.

value

In case of adf.file.time an object of class base::POSIXt. In case of adf.file.mode either a character string representing the flags, or a vector of named logical values, where the name of the logical represents the flag to be altered (see also details).

which

Character indicating which time to obtain/modify. One of "m" (date modified), "c" (date created), or "a" (date root modification). This parameter works only on the disk's root and will be ignored for any other directory or file.

Value

In case of the replace methods, an amigaDisk class object is returned with the file information updated. Otherwise, it will return the requested file information (see also details).

Details

Use adf.file.mode to obtain or set a character string reflecting which file mode flags are set, where:

  • D: deletable

  • E: executable

  • W: writeable

  • R: readable

  • A: archived

  • P: pure command

  • S: script

  • H: hold

  • starting without lower case: applies to user

  • starting with lower case g: applies to group

  • starting with lower case o: applies to other

Use adf.file.time to obtain or set the base::POSIXt properties of a file on an amigaDisk.

Use adf.file.info to obtain a combination of the information listed above in a data.frame.

Author

Pepijn de Vries

Examples

if (FALSE) {
data(adf.example)

adf.file.mode(adf.example,  c("mods", "mods/mod.intro"))
adf.file.time(adf.example, c("mods", "mods/mod.intro"))
adf.file.size(adf.example,  c("mods", "mods/mod.intro"))
adf.file.info(adf.example,  c("mods", "mods/mod.intro"))

## set the writeable flag for a group to TRUE
adf.file.mode(adf.example, "mods/mod.intro") <- c(gW = T)

## Set the modified time-stamp to the current system time
adf.file.time(adf.example, "mods/mod.intro") <- Sys.time()
}