IRAF help page for package language, program access

from NOAO access -- test whether a file existsUSAGEPARAMETERSDESCRIPTIONEXAMPLESBUGSSEE ALSO

access -- test whether a file exists


USAGE

bool = access (filename)


PARAMETERS

filename

The name of the file whose existence is to be tested.


DESCRIPTION

Access is a boolean intrinsic function returning true ("yes") if the named file exists. Access can only be called as a function in an expression, not as a task.


EXAMPLES

1. Type a file if it exists.

    if (access ("lib$motd"))
	type ("lib$motd")
    else
	error (11, "File not found")

2. Tell if a file exists.

cl> = access ("lib$motd")


BUGS

An optional second argument should be added to test whether the named file can be accessed for reading or writing.


SEE ALSO

.ih, directory,


This page automatically generated from the iraf .hlp file. If you would like your local iraf package .hlp files converted into HTML please contact Dave Mills at NOAO.

dmills@noao.edu