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



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

GetSubDirs

Declaration

Source position: line 0

procedure GetSubDirs(

  Dir: String;

  const wildcard: String;

  var result: TDirNames

); overload;

procedure GetSubDirs(

  Dir: String;

  var result: TDirNames

); overload;

Notes

Returns list of subdirectories in the result record. The function looks in the directory for all subfolders (one level deep, not recursive).

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.

This function does not return '.' dot or '..' dot dot listings, nor does it return files.

Example

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

Tips

If you do want to include in the resultset any dot dot ".." listings then use the GetDirContent function.





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