aboutsummaryrefslogtreecommitdiff
path: root/pkg/language/doc/access.hlp
blob: d68649b4bdb0ec603498bf4a50703a56d7e7d36c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
.help "access,imaccess" Feb86 language
.ih
NAME
access -- test whether a file exists
.ih
USAGE
bool = access (filename)
bool = imaccess (imagename)
.ih 
PARAMETERS
.ls filename
The name of the file whose existence is to be tested.
.le
.ls imagename
The name of the image whose existence is to be tested.
.le
.ih
DESCRIPTION
\fIAccess\fR is a boolean intrinsic function returning true ("yes") if the
named file exists.  \fIAccess\fR can only be called as a function in an
expression, not as a task.
.ih
EXAMPLES
1. Type a file if it exists.

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

2. Tell if a file and an image exists.

.nf
	cl> = access ("lib$motd")
	cl> = imaccess ("dev$pix")
.fi


.ih
BUGS
An optional second argument should be added to test whether the named file
can be accessed for reading or writing.
.endhelp
.ih
SEE ALSO
directory