-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathf_access.f90
63 lines (63 loc) · 1.75 KB
/
f_access.f90
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
!-----------------------------------------------------------------------
!
! Tests for file accessibility:
!
!-----------------------------------------------------------------------
!
! Level 1:
!
!-----
!
subroutine f_access ( path, mode, res )
!
use mod_funx_param, only: ck_int, ck_char_nul
implicit none
!
! include 'i_param.inc'
!
character(len=*),intent(in) :: path
integer(kind=ck_int),intent(in) :: mode
integer(kind=ck_int),intent(out) :: res
!
external c_access
!
!
call c_access ( path//ck_char_nul, mode, res )
!
end subroutine f_access
!-----------------------------------------------------------------------
!
! Level 2:
!
!-----
!
!
!-----------------------------------------------------------------------
!
! access() -- Tests for file accessibility.
!
! Synopsis:
! #include <unistd.h>
! int access ( const char *path, int amode );
!
! Arguments:
! path Pointer to the name of file to be checked.
! amode Bitwise OR of the access permissions to be checked
! R_OK for read,
! W_OK for write,
! X_OK for execute, and
! F_OK for existence.
!
! Returns:
! 0 If access is allowed.
! -1 On error with errno set to indicate the error. If access is not allowed,
! errno will be set to EACCES.
!
! Errors:
! EACCES, EINVAL, ENAMETOOLONG, ENOENT, ENOTDIR, EROFS
!
! Description:
! The access() function checks the accessibility of the file named by the PATH argument
! for the permissions indicated by AMODE, using the real user ID in place of the effective
! user ID and the real group ID in place of the effective group ID.
!