50% off | Unlimited Data & AI Learning

Last chance! 50% off unlimited learning

Sale ends in


adfExplorer (version 0.1.8)

adf.file.exists: Test file or directory existence in an amigaDisk object

Description

Tests whether a specific file (or directory) exists in an amigaDisk object.

Usage

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

# S4 method for amigaDisk,character dir.exists.adf(x, path)

Value

Returns a logical value indicating whether the file exists or not. In case of dir.exists.adf the path needs to exist and it needs to be a directory in order to return TRUE.

Arguments

x

An amigaDisk object in which this method will check for the file's existence.

file

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.

path

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

Author

Pepijn de Vries

Details

This method will look for a file/directory header, based on its name. If such a header exists, it is assumed that the file exists. The file/directory itself is not checked for validity.

Examples

Run this code
data(adf.example)

## This file exists:
adf.file.exists(adf.example, "df0:mods/mod.intro")

## But it doesn't exist as a directory
dir.exists.adf(adf.example, "df0:mods/mod.intro")

## This file also doesn't:
adf.file.exists(adf.example, "df0:idontexist")

Run the code above in your browser using DataLab