ex49.pp 350 B

12345678910111213141516171819202122
  1. Program Example49;
  2. { Program to demonstrate the Glob and GlobFree functions. }
  3. Uses linux;
  4. Var G1,G2 : PGlob;
  5. begin
  6. G1:=Glob ('*');
  7. if LinuxError=0 then
  8. begin
  9. G2:=G1;
  10. Writeln ('Files in this directory : ');
  11. While g2<>Nil do
  12. begin
  13. Writeln (g2^.name);
  14. g2:=g2^.next;
  15. end;
  16. GlobFree (g1);
  17. end;
  18. end.