UNIX Free Pascal


. proc - 3


elem:=readdir(d); (* *)

while elem<>nil do (* *)

begin

(* *)

val(strpas(elem^.name),number,coder);

(* , *)

if coder=0 then

begin

(* status /proc/_/fd *)

strcopy(fullpath,'/proc/');

strcat(fullpath,elem^.name);

strcat(fullpath,'/fd');

d1:=opendir(fullpath);

if d1=nil then

writeln(' ',number,' ')

else

begin

writeln(' ',number,' :');

elem1:=readdir(d1); (* *)

while elem1<>nil do (* *)

begin

strcopy(fullpath1,fullpath);

strcat(fullpath1,'/');

strcat(fullpath1,elem1^.name);

if (strcomp(elem1^.name,'.')<>0) and (strcomp(elem1^.name,'..')<>0) then

begin

(*realname[readlink(realname,fullpath1,999)]:=#0;*)

writeln(#9,readlink(strpas(fullpath1)));

end;

elem1:=readdir(d1); (* *)

end;

end;

end;

elem:=readdir(d); (* *)

end;

closedir(d); (* opendir *)

end.

 

13.38. /proc, , .

uses sysutils,crt,linux;

 

var

f:text;

count:integer;

ch:char;

begin

assign(f,'/proc/version');

reset(f);

if IOResult<>0 then

begin

writeln(' , ');

halt;

end;

 

textcolor(7);

write(' - ');




- -  - -  - -