UNIX Free Pascal


. - 4


while not EOF (tx) do

begin

readln(tx,ts);

uid:=pos(':',ts);

nam1:=copy(ts,1,uid-1);

delete(ts,1,uid);

uid:=pos(':',ts);

delete(ts,1,uid);

namb1:=copy(ts,1,uid-1);

if namb1='500' then

write(nam1)

end;

close(tx);

getname:=nam1;

end;

 

function getgroup(gid:integer):string;

const q='/etc/group';

var ts,nam,namb:string;

t:text;

begin

assign(t,q);

reset(t);

while not EOF (t) do

begin

readln(t,ts);

gid:=pos(':',ts);

nam:=copy(ts,1,gid-1);

delete(ts,1,gid);

gid:=pos(':',ts);

delete(ts,1,gid);

namb:=copy(ts,1,gid-1);

if namb='500' then

write(nam);

end;

close(t);

getgroup:=nam;

end;

 

function gettype(mode:integer):char;

begin

if S_ISREG(mode) then

gettype:='-'

else

if S_ISDIR(mode) then

gettype:='d'

else

if S_ISCHR(mode) then

gettype:='c'

else

if S_ISBLK(mode) then

gettype:='b'

else

if S_ISFIFO(mode) then

gettype:='p'

else

gettype:='l';

end;

 

function getrights(mode:integer):string;

const

sympr:array [0..7] of string=(

'---', {0}

'--x', {1}

'-w-', {2}

'-wx', {3}

'r--', {4}

'r-x', {5}

'rw-', {6}

'rwx' {7}

);

specsympr:array [0..7] of string=(

'---', {0}

'--t', {1}

'-s-', {2}

'-st', {3}

's--', {4}

's-t', {5}

'ss-', {6}




- -  - -  - -