[Overview][Constants][Types][Procedures and functions][Variables] |
Check file access
Source position: oldlinux.pp line 1400
function Access( |
Path: PathStr; |
mode: Integer |
):Boolean; |
Accesstests user's access rights on the specified file. Modeis 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 access is denied, or an error occurred, Falseis returned.
LinuxErroris used to report errors:
|
Change owner of file |
|
|
Change file permission bits |
Program Example26; { Program to demonstrate the Access function. } Uses oldlinux; begin if Access ('/etc/passwd',W_OK) then begin Writeln ('Better check your system.'); Writeln ('I can write to the /etc/passwd file !'); end; end.