*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->IRIX man pages -> standard/access (2)              


access(2)							     access(2)

NAME    [Toc]    [Back]

     access - determine	accessibility of a file

SYNOPSIS    [Toc]    [Back]

     #include <unistd.h>

     int access(const char *path, int amode);

DESCRIPTION    [Toc]    [Back]

     path points to a path name	naming a file.	access checks the named	file
     for accessibility according to the	bit pattern contained in 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.  The bit pattern contained in amode
     is	constructed by an OR of	the following constants	(defined in

	  R_OK	    test for read permission
	  W_OK	    test for write permission
	  X_OK	    test for execute (search) permission
	  F_OK	    test for existence of file
	  EX_OK		 test for regular, executable file
	  EFF_ONLY_OK	 test using effective IDs

     Note that successful checking of the EX_OK	file does not imply that the
     exec(2) system call will succeed on the file named	by path, since the
     check succeeds if at least	one execute bit	is set;	 there are also
     additional	checks made for	execute	permission by exec.

     Access to the file	is denied if one or more of the	following are true:

     EACCES		 Search	permission is denied on	a component of the
			 path prefix.

     EACCES		 Access	permission is denied.

     EACCES		 The file is not a regular file.

     EFAULT		 path points outside the allocated address space for
			 the process.

     EINTR		 A signal was caught during the	access system call.

     EINVAL		 amode is invalid.

     ELOOP		 Too many symbolic links were encountered in
			 translating path.

     EMULTIHOP		 Components of path require hopping to multiple	remote

									Page 1

access(2)							     access(2)

     ENAMETOOLONG	 The length of the path	argument exceeds {PATH_MAX},
			 or the	length of a path component exceeds {NAME_MAX}
			 while _POSIX_NO_TRUNC is in effect.

     ENOTDIR		 A component of	the path prefix	is not a directory.

     ENOENT		 Read, write, or execute (search) permission is
			 requested for a null path name.

     ENOENT		 The named file	does not exist.

     ENOLINK		 path points to	a remote machine and the link to that
			 machine is no longer active.

     ETIMEDOUT		 The named file	is located on a	remote file system
			 which is not available	[see intro(2)].

     EROFS		 Write access is requested for a file on a read-only
			 file system.

SEE ALSO    [Toc]    [Back]

     chmod(2), stat(2)
     ``File Access Permission''	in intro(2)

DIAGNOSTICS    [Toc]    [Back]

     If	the requested access is	permitted, a value of 0	is returned.
     Otherwise,	a value	of -1 is returned and errno is set to indicate the

									PPPPaaaaggggeeee 2222
[ Back ]
 Similar pages
Name OS Title
access Tru64 Determines the accessibility of a file
access FreeBSD check accessibility of a file
eaccess FreeBSD check accessibility of a file
pxfaccess IRIX Checks the accessibility of a named file
rqsread IRIX reads the information out of an ELF file that is needed to determine if the file needs to be requickstarted
isastream Tru64 Determine if a file descriptor refers to a STREAMS file
useracc FreeBSD check memory regions for accessibility
volinfo Tru64 Print accessibility and usability of volumes
kernacc FreeBSD check memory regions for accessibility
vxinfo HP-UX print accessibility and usability of volumes
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service