UNIX Free Pascal


. - 13


else

begin

if not (gettype(st.mode) = 'd') then

begin

writeln(' ',polniypath);

//unlink(polniypath);

if not unlink(polniypath) then

begin

writeln(' ',polniypath);

flag:=false;(* - *)

end;

end;

end;

el:=readdir(d);

end;

closedir(d);

d:=opendir(name);

el:=readdir(d);

while el<>nil do

begin

polniypath:=name;

if strcomp(name,'/')=0 then

strcat(polniypath,el^.name)

else

begin

if name[strlen(name)-1]<>'/' then

strcat(polniypath,'/');

strcat(polniypath,el^.name);

end;

if not fstat(pchar(polniypath),st) then

writeln(' stat ',polniypath)

else

begin

if (gettype(st.mode)='d') and

(strcomp(el^.name,'.')<>0) and

(strcomp(el^.name,'..')<>0) then

begin

writeln(' ',polniypath);

if not obhod(polniypath) then

flag:=false;

end;

end;

el:=readdir(d);

end;

closedir(d);

if not flag then

writeln(' ',name,

' , .. ')

else

begin

{$i-}

rmdir(name);

if ioresult <> 0 then

begin

writeln(' ',name);

flag:=false;

end;

end;

writeln(' ',name, ' ',flag);

obhod:=flag;

end;

 

 

var

name:array [0..2000] of char;

begin

if paramcount<>0 then

begin

name:=paramstr(1);

obhod(name);

end

else

writeln(' : ',paramstr(0),' ');

end.

 




- -  - -  - -