Check file access.
Source position: bunxh.inc line 87
function FpAccess( |
pathname: PAnsiChar; |
aMode: cint |
):cint; |
const pathname: RawByteString; |
aMode: cint |
):cint; |
FpAccess tests user's access rights on the specified file. Mode is a mask existing of one or more of the following:
The test is done with the real user ID, instead of the effective user ID. If the user has the requested rights, zero is returned. If access is denied, or an error occurred, a nonzero value is returned.
Extended error information can be retrieved using fpGetErrno.
|
Change owner of file. |
|
|
Change file permission bits. |
Program Example26; { Program to demonstrate the Access function. } Uses BaseUnix; begin if fpAccess ('/etc/passwd',W_OK)=0 then begin Writeln ('Better check your system.'); Writeln ('I can write to the /etc/passwd file !'); end; end.