access - return access mode (r,w,x) or existence of a file
integer*4 function access (name, mode) character*(*) name, mode
Example: ierr = access ( 'MyFile', 'r' )
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 following:
Test for read permission
Test for write permission
Test for execute permission
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.
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'
libfsu.a