struct dirent ** x = NULL;
int n = scandir (p, &x, NULL, alphasort);
auto directory_contents(auto path) {
auto iterator = std::filesystem::directory_iterator(path);
return std::vector<std::filesystem::path>(
std::ranges::begin(iterator),
std::ranges::end(iterator)
);
}
auto main(int argc, char** argv) -> int {
auto path = argc >= 2
? std::filesystem::path(argv[1])
: std::filesystem::current_path();
for (auto entry : directory_contents(path)) {
std::cout << entry.string() << std::endl;
}
}
auto x = dirEntries(d, SpanMode.shallow);
final File directory = new File(d);
final File[] x = directory.listFiles();
x = os.listdir(d)
struct dirent ** x = NULL; int n = scandir (p, &x, NULL, alphasort);
(def x ((comp file-seq clojure.java.io/file) d))
auto directory_contents(auto path) { auto iterator = std::filesystem::directory_iterator(path); return std::vector<std::filesystem::path>( std::ranges::begin(iterator), std::ranges::end(iterator) ); } auto main(int argc, char** argv) -> int { auto path = argc >= 2 ? std::filesystem::path(argv[1]) : std::filesystem::current_path(); for (auto entry : directory_contents(path)) { std::cout << entry.string() << std::endl; } }
var files = Directory.GetFiles(dirPath);
auto x = dirEntries(d, SpanMode.shallow);
var x = Directory(d).listSync();
x, err := os.ReadDir(d)
do x <- listDirectory d -- do something with x
const x = fs.readdirSync(d)
final File directory = new File(d); final File[] x = directory.listFiles();
String x[] = new File(d).list();
$x = scandir($d);
if FindFirst(IncludeTrailingPathDelimiter(d) + '*', faAnyFile and (not faDirectory), SR) = 0 then repeat x.Add(SR.Name); until FindNext(SR) <> 0; FindClose(SR);
x := FindAllFiles(d, '*', False);
my @x = map {basename $_} glob("$d/*");
opendir my $dh, $d or die "Could not open $d for reading: $!\n"; @x = readdir $dh; closedir $dh;
x = Dir.children(d)
let x = std::fs::read_dir(d)?.collect::<Result<Vec<_>, _>>()?;
let x = std::fs::read_dir(d).unwrap();