[Overview][Constants][Types][Procedures and functions][Variables] | Reference for unit 'oldlinux' (#rtl) |
Check file access
Source position: oldlinux.pp line 1400
function Access( |
Path: PathStr; |
mode: Integer |
):Boolean; |
Access 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 access is denied, or an error occurred, False is returned.
LinuxError is 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.
No notes exist for this page yet.