summaryrefslogtreecommitdiff
path: root/fpcdocs/unixex/ex49.pp
blob: cda81e8fba9c2e644b3eb48e3b3f06c74af63cde (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
Program Example49;

{ Program to demonstrate the Glob and GlobFree functions. }

Uses BaseUnix,Unix;

Var G1,G2 : PGlob;

begin
  G1:=Glob ('*');
  if fpgeterrno=0 then
    begin
    G2:=G1;
    Writeln ('Files in this directory : ');
    While g2<>Nil do
      begin
      Writeln (g2^.name);
      g2:=g2^.next;
      end;
    GlobFree (g1);
    end;
end.