Добавил:
bagiwow
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз:
Предмет:
Файл:Паскаль / do9 / iriepas201 / Irie Pascal / samples / permiss
.pasprogram permissions(input, output);
var
s : filename;
mode : integer;
isdir : boolean;
begin
write('Enter filename:');
readln(s);
s := fexpand(s);
getfilemode(s, mode);
isdir := (mode and dir_bit) <> 0;
if isdir then
writeln(s, ' is a directory')
else
writeln(s, ' is not a directory');
writeln('File mode is $', hex(mode), mode);
write('User permissions :');
if (mode and usr_r) <> 0 then
write(' Read');
if (mode and usr_w) <> 0 then
write(' Write');
if (mode and usr_x) <> 0 then
if isdir then
write(' Search')
else
write(' Execute');
writeln;
write('Group permissions :');
if (mode and grp_r) <> 0 then
write(' Read');
if (mode and grp_w) <> 0 then
write(' Write');
if (mode and grp_x) <> 0 then
if isdir then
write(' Search')
else
write(' Execute');
writeln;
write('Other permissions :');
if (mode and oth_r) <> 0 then
write(' Read');
if (mode and oth_w) <> 0 then
write(' Write');
if (mode and oth_x) <> 0 then
if isdir then
write(' Search')
else
write(' Execute');
writeln;
end.
Соседние файлы в папке samples