DirContents
Description
Vector type for directory contents.
Usage example (Cross-references)
Usage examples (Cross-references)
- In
Dir.c:73:
#ifdef _WIN32
// Windows-specific implementation using FindFirstFile/FindNextFile
DirContents DirGetContents(const char *path, Allocator *alloc) {
if (!path || !alloc) {
LOG_FATAL("Invalid argument");- In
Dir.c:78:
}
DirContents dc = (DirContents)VecInit(alloc);
// Construct the search path with a wildcard
- In
Dir.c:119:
#else
// APPLE or Unix based system implementation using opendir/readdir
DirContents DirGetContents(const char *path, Allocator *alloc) {
if (!path || !alloc) {
LOG_FATAL("invalid arguments.");- In
Dir.c:124:
}
DirContents dc = (DirContents)VecInit(alloc);
DIR *dir = opendir(path);- In
Dir.h:83:
/// TAGS: System, FileSystem, Directory
///
DirContents DirGetContents(const char *path, Allocator *alloc);
///
- In
MisraDoc.c:214:
Str *dir_name = &dir_paths.data[i];
DirContents dir_contents = DirGetContents(dir_name->data, &alloc.base);
VecForeach(&dir_contents, dir_entry) {
if (dir_entry.type == SYS_DIR_ENTRY_TYPE_DIRECTORY) {
Last updated on