[Overview][Constants][Types][Procedures and functions][Variables] | Reference for unit 'oldlinux' (#rtl) |
Change file permission bits
Source position: oldlinux.pp line 1398
function Chmod( |
path: PathStr; |
Newmode: LongInt |
):Boolean; |
Chmod Sets the Mode bits of the file in Path to NewMode. Newmode can be specified by 'or'-ing the following:
Errors are returned in LinuxError.
|
Change owner of file |
|
|
Check file access |
|
|
Convert octal to decimal value |
Program Example23; { Program to demonstrate the Chmod function. } Uses oldlinux; Var F : Text; begin { Create a file } Assign (f,'testex21'); Rewrite (F); Writeln (f,'#!/bin/sh'); Writeln (f,'echo Some text for this file'); Close (F); { Octal() makes the correct number from a number that LOOKS octal } Chmod ('testex21',octal (777)); { File is now executable } execl ('./testex21'); end.
No notes exist for this page yet.