Implementation
Pascal

Be concise.

Be useful.

All contributions dictatorially edited by webmasters to match personal tastes.

Please do not paste any copyright violating resource.

Please try to avoid dependencies to third-party libraries and frameworks.

Other implementations
import "io/ioutil"
x, err := ioutil.ReadDir(d)
SysUtils, Classes
  if FindFirst(IncludeTrailingPathDelimiter(d) + '*', 
               faAnyFile and (not faDirectory), SR) = 0 then
  repeat
    x.Add(SR.Name);
  until FindNext(SR) <> 0;
  FindClose(SR);
x = Dir.children(d)
use std::fs;
let x = fs::read_dir(d).unwrap();
import os
x = os.listdir(d)
import std.file;
auto x = dirEntries(d, SpanMode.shallow);