opendir 是 POSIX 标准 中定义的目录遍历函数,属于 C 标准库(glibc),而不是 Debian 特有的功能。因此:
opendiropendiropendir 来自哪里?#include <dirent.h>| Debian 版本 | glibc 版本 | opendir 支持 |
|---|---|---|
| Debian 7 (wheezy) | 2.13 | ✅ |
| Debian 8 (jessie) | 2.19 | ✅ |
| Debian 9 (stretch) | 2.24 | ✅ |
| Debian 10 (buster) | 2.28 | ✅ |
| Debian 11 (bullseye) | 2.31 | ✅ |
| Debian 12 (bookworm) | 2.36 | ✅ |
| Debian 13 (trixie) | 2.39+ | ✅ |
✅ 所有 Debian 版本均支持 opendir
#include <dirent.h>
#include <stdio.h>
int main() {
DIR *dir = opendir(".");
if (!dir) {
perror("opendir");
return 1;
}
struct dirent *entry;
while ((entry = readdir(dir)) != NULL) {
printf("%s\n", entry->d_name);
}
closedir(dir);
return 0;
}
opendirreaddirclosedirrewinddirseekdirtelldirDebian 所有版本都支持
opendir,因为它属于 POSIX 标准,由 glibc 提供。
如果你是想问:
opendir 在 某个特定 Debian 版本是否可用可以继续具体说明,我可以详细解释。