[Overview][Constants][Types][Procedures and functions] | Reference for unit 'BaseUnix' (#rtl) |
Check file access
Source position: line 0
function FpAccess( |
pathname: pChar; |
aMode: cint |
):cint; |
pathname: AnsiString; |
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.
No notes exist for this page yet.