diff options
| author | Sadie Powell <sadie@witchery.services> | 2022-12-17 15:44:44 +0000 |
|---|---|---|
| committer | Sadie Powell <sadie@witchery.services> | 2022-12-17 16:03:28 +0000 |
| commit | 3f3062a0773d0a45941f6db2534989a07256f267 (patch) | |
| tree | 3e9080e751e5a26a2d49ef4412833ba6456edb18 /src/win32/dir/dir.cpp | |
| parent | 8a8fb7725b4433b725866cc8842edf40ec8b7025 (diff) | |
Use <filesystem> instead of opendir/readdir/closedir.
Diffstat (limited to 'src/win32/dir/dir.cpp')
| -rw-r--r-- | src/win32/dir/dir.cpp | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/src/win32/dir/dir.cpp b/src/win32/dir/dir.cpp deleted file mode 100644 index 8c8cdf907..000000000 --- a/src/win32/dir/dir.cpp +++ /dev/null @@ -1,48 +0,0 @@ -/* POSIX emulation layer for Windows. - * - * (C) 2008-2022 Anope Team - * Contact us at team@anope.org - * - * Please read COPYING and README for further details. - */ - -#include "dir.h" -#include <stdio.h> - -DIR *opendir(const char *path) -{ - char real_path[MAX_PATH]; - _snprintf(real_path, sizeof(real_path), "%s/*", path); - - DIR *d = new DIR(); - d->handle = FindFirstFile(real_path, &d->data); - d->read_first = false; - - if (d->handle == INVALID_HANDLE_VALUE) - { - delete d; - return NULL; - } - - return d; -} - -dirent *readdir(DIR *d) -{ - if (d->read_first == false) - d->read_first = true; - else if (!FindNextFile(d->handle, &d->data)) - return NULL; - - d->ent.d_ino = 1; - d->ent.d_name = d->data.cFileName; - - return &d->ent; -} - -int closedir(DIR *d) -{ - FindClose(d->handle); - delete d; - return 0; -} |
