ACCESS(3F)ACCESS(3F)NAMEaccess - return access mode (r,w,x) or existence of a file
SYNOPSIS
integer*4 function access (name, mode)
character*(*) name, mode
USAGE
Example: ierr = access ( 'MyFile', 'r' )
DESCRIPTION
The access function checks the given file, name, for accessability with
respect to the caller according to mode. The mode argument can
include, in any order, and in any combination, one or more of the fol‐
lowing:
r Test for read permission
w Test for write permission
x Test for execute permission
(blank)
Test for existence
An error code is returned if either the argument is illegal, or if the
file cannot be accessed in all of the specified modes. 0 is returned
if the specified access would be successful.
EXAMPLE
To test for read and write permission:
integer*4 access, st
st = access('anyfile.data', 'rw')
if( st .ne.0 ) print*, 'Cannot read/write file'
FILES
libfui.a
SEE ALSOaccess(2), gerror(3F), perror(3F)
03/02/25 ACCESS(3F)