next up previous contents index
Next: GlobFree Up: Functions and procedures Previous: DirName

Glob

   

Declaration:

Function Glob (Const Path : Pathstr) : PGlob;

Description:

Glob returns a pointer to a glob structure which contains all filenames which exist and match the pattern in Path.

The pattern can contain wildcard characters, which have their usual meaning.

The pglob structure is defined as : Some more text.

Errors:

Returns nil on error, and LinuxError is set.

sys_enomem
No memory on heap for glob structure.
others
As returned by the opendir call, and sys_readdir.

See also:

GlobFree, Glob (3)

Example
Program Example49;

{ Program to demonstrate the Glob and GlobFree functions. }

Uses linux;

Var G1,G2 : PGlob;

begin
  G1:=Glob ('*');
  if LinuxError=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.



Michael Van Canneyt
Tue Mar 31 16:46:10 CEST 1998