help files
Z505 | PasWiki | FUQ | Search | Main Docs | API Guide



[Overview][Types][Procedures and functions] Reference for unit 'dirutils' (#powtils_main)

GetFiles

Declaration

Source position: line 0

procedure GetFiles(

  Dir: String;

  const wildcard: String;

  var result: TFileNames

); overload;

procedure GetFiles(

  Dir: String;

  var result: TFileNames

); overload;

Notes

Returns list of files in the result record. The function looks in the directory for all files (one level deep, not recursive). It does not include in the resultset any sub directories or dot dot ".." listings.

Matching a wildcard pattern such as *.* is optional in the overloaded function. The wildcard syntax is the same as the FindFile wildcards in the sysutils unit.

Example

var got: TFileNames;
    i: integer;
begin
  GetFiles('somepath/', got);
  for i:= low(got.files) to got.count-1 do 
    writeln(got.files{i});
end.





lufdoc, Powtils, fpc, freepascal, delphi, kylix, c/c++, mysql, cgi web framework docs, Z505